elastic / apm-server
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
txt
mod
mk
gitattributes
tpl
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.

main22422 LOC (35%) 271 files
test18310 LOC (28%) 149 files
generated135 LOC (<1%) 1 file
build and deployment1112 LOC (1%) 27 files
other21614 LOC (33%) 119 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 271 files match defined criteria (22,422 LOC, 100.0% vs. main code):
    • 204 *.go files (19,233 LOC)
    • 40 *.tf files (2,638 LOC)
    • 10 *.yaml files (293 LOC)
    • 13 *.tfvars files (209 LOC)
    • 2 *.tpl files (25 LOC)
    • 2 *.ps1 files (24 LOC)
  • " *.go" is biggest, containing 85.78% of LOC.
  • " *.ps1" is smallest, containing 0.11% of LOC.


*.go19233 LOC (85%) 204 files
*.tf2638 LOC (11%) 40 files
*.yaml293 LOC (1%) 10 files
*.tfvars209 LOC (<1%) 13 files
*.tpl25 LOC (<1%) 2 files
*.ps124 LOC (<1%) 2 files
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 ".*/test_.*".
    • files with paths like ".*/test[.].*".
  • 149 files match defined criteria (18,310 LOC, 81.7% vs. main code):
    • 143 *.go files (18,137 LOC)
    • 6 *.sh files (173 LOC)
  • " *.go" is biggest, containing 99.06% of LOC.
  • " *.sh" is smallest, containing 0.94% of LOC.


*.go18137 LOC (99%) 143 files
*.sh173 LOC (<1%) 6 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/generated/.*".
    • files with paths like ".*/gen/.*[.]go".
  • 1 file matches defined criteria (135 LOC, 0.6% vs. main code). All matches are in *.go files.


*.go135 LOC (100%) 1 file
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]mk".
    • files with paths like ".*/[.]gitattributes".
  • 27 files match defined criteria (1,112 LOC, 5.0% vs. main code):
    • 24 *.sh files (604 LOC)
    • 3 *.mk files (508 LOC)
  • " *.sh" is biggest, containing 54.32% of LOC.
  • " *.mk" is smallest, containing 45.68% of LOC.


*.sh604 LOC (54%) 24 files
*.mk508 LOC (45%) 3 files
Other Code
txt
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[Ee]xamples/.*".
  • 119 files match defined criteria (21,614 LOC, 96.4% vs. main code):
    • 70 *.json files (19,275 LOC)
    • 38 *.md files (1,445 LOC)
    • 7 *.txt files (457 LOC)
    • 4 *.mod files (437 LOC)
  • " *.json" is biggest, containing 89.18% of LOC.
  • " *.mod" is smallest, containing 2.02% of LOC.


*.json19275 LOC (89%) 70 files
*.md1445 LOC (6%) 38 files
*.txt457 LOC (2%) 7 files
*.mod437 LOC (2%) 4 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 19:42