elastic / opentelemetry-collector-contrib
Source Code Overview

Analysis scope, overview of main, test, generated, deployment, build, and other code.

Source Code Analysis Scope
Files includes and excluded from analyses
mod
txt
in
proto
gitattributes
ini
cfg
lua
Overview of Analyzed Files
Basic stats on analyzed files
Intro
For analysis purposes we separate files in scope into several categories: main, test, generated, deployment and build, and other.

  • The main category contains all manually created source code files that are being used in the production.
  • Files in the main category are used as input for other analyses: logical decomposition, concerns, duplication, file size, unit size, and conditional complexity.
  • Test source code files are used only for testing of the product. These files are normally not deployed to production.
  • Build and deployment source code files are used to configure or support build and deployment process.
  • Generated source code files are automatically generated files that have not been manually changed after generation.
  • While a source code folder may contain a number of files, we are primarily interested in the source code files that are being written and maintained by developers.
  • Files containing binaries, documentation, or third-party libraries, for instance, are excluded from analysis. The exception are third-party libraries that have been changed by developers.

main362494 LOC (39%) 3,619 files
test477829 LOC (51%) 3,054 files
generated215 LOC (<1%) 3 files
build and deployment187 LOC (<1%) 4 files
other83821 LOC (9%) 791 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 3619 files match defined criteria (362,494 LOC, 100.0% vs. main code):
    • 3,231 *.go files (342,385 LOC)
    • 362 *.yaml files (18,672 LOC)
    • 4 *.proto files (684 LOC)
    • 20 *.sql files (597 LOC)
    • 1 *.graphql files (146 LOC)
    • 1 *.html files (10 LOC)
  • " *.go" is biggest, containing 94.45% of LOC.
  • " *.html" is smallest, containing 0% of LOC.


*.go342385 LOC (94%) 3,231 files
*.yaml18672 LOC (5%) 362 files
*.proto684 LOC (<1%) 4 files
*.sql597 LOC (<1%) 20 files
*.graphql146 LOC (<1%) 1 file
*.html10 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/mock[a-zA-Z0-9_\- ]+/.*".
    • files with paths like ".*/[Mm]ocks/.*".
    • files with paths like ".*/testing[.].*".
    • files with paths like ".*_mock[.][a-zA-Z0-9_\-]+".
    • files with paths like ".*/[Tt]ests/.*".
  • 3054 files match defined criteria (477,829 LOC, 131.8% vs. main code):
    • 3,025 *.go files (473,432 LOC)
    • 28 *.xml files (4,394 LOC)
    • 1 *.yaml files (3 LOC)
  • " *.go" is biggest, containing 99.08% of LOC.
  • " *.yaml" is smallest, containing 0% of LOC.


*.go473432 LOC (99%) 3,025 files
*.xml4394 LOC (<1%) 28 files
*.yaml3 LOC (<1%) 1 file
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with any line of content like "//[ ]*Generated by .*".
  • 3 files match defined criteria (215 LOC, 0.1% vs. main code). All matches are in *.go files.


*.go215 LOC (100%) 3 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/docker[-]compose[.]yaml".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 4 files match defined criteria (187 LOC, 0.1% vs. main code):
    • 3 *.sh files (121 LOC)
    • 1 *.yaml files (66 LOC)
  • " *.sh" is biggest, containing 64.71% of LOC.
  • " *.yaml" is smallest, containing 35.29% of LOC.


*.sh121 LOC (64%) 3 files
*.yaml66 LOC (35%) 1 file
Other Code
mod
txt
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]ini".
  • 791 files match defined criteria (83,821 LOC, 23.1% vs. main code):
    • 409 *.md files (51,255 LOC)
    • 318 *.mod files (28,886 LOC)
    • 37 *.yaml files (1,953 LOC)
    • 21 *.json files (1,290 LOC)
    • 3 *.txt files (338 LOC)
    • 1 *.go files (69 LOC)
    • 1 *.sh files (24 LOC)
    • 1 *.ini files (6 LOC)
  • " *.md" is biggest, containing 61.15% of LOC.
  • " *.ini" is smallest, containing 0.01% of LOC.


*.md51255 LOC (61%) 409 files
*.mod28886 LOC (34%) 318 files
*.yaml1953 LOC (2%) 37 files
*.json1290 LOC (1%) 21 files
*.txt338 LOC (<1%) 3 files
*.go69 LOC (<1%) 1 file
*.sh24 LOC (<1%) 1 file
*.ini6 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 20:12