elastic / elastic-agent
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
tpl
txt
mod
proto
editorconfig
http
gitattributes
hcl
asc
properties
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.

main92984 LOC (50%) 814 files
test70796 LOC (38%) 319 files
generated0 LOC (0%) 0 files
build and deployment129 LOC (<1%) 10 files
other18716 LOC (10%) 92 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
tpl
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 814 files match defined criteria (92,984 LOC, 100.0% vs. main code):
    • 563 *.go files (77,720 LOC)
    • 194 *.yaml files (11,759 LOC)
    • 23 *.tpl files (1,691 LOC)
    • 20 *.asciidoc files (572 LOC)
    • 7 *.tf files (479 LOC)
    • 2 *.proto files (445 LOC)
    • 1 *.c files (165 LOC)
    • 1 *.g4 files (88 LOC)
    • 2 *.ps1 files (63 LOC)
    • 1 *.tfvars files (2 LOC)
  • " *.go" is biggest, containing 83.58% of LOC.
  • " *.tfvars" is smallest, containing 0% of LOC.


*.go77720 LOC (83%) 563 files
*.yaml11759 LOC (12%) 194 files
*.tpl1691 LOC (1%) 23 files
*.asciidoc572 LOC (<1%) 20 files
*.tf479 LOC (<1%) 7 files
*.proto445 LOC (<1%) 2 files
*.c165 LOC (<1%) 1 file
*.g488 LOC (<1%) 1 file
*.ps163 LOC (<1%) 2 files
*.tfvars2 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 ".*/mock[a-zA-Z0-9_\- ]+/.*".
    • files with paths like ".*/[Mm]ocks/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*_mock[.][a-zA-Z0-9_\-]+".
  • 319 files match defined criteria (70,796 LOC, 76.1% vs. main code):
    • 316 *.go files (70,648 LOC)
    • 3 *.tf files (148 LOC)
  • " *.go" is biggest, containing 99.79% of LOC.
  • " *.tf" is smallest, containing 0.21% of LOC.


*.go70648 LOC (99%) 316 files
*.tf148 LOC (<1%) 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 10 files match defined criteria (129 LOC, 0.1% vs. main code). All matches are in *.sh files.


*.sh129 LOC (100%) 10 files
Other Code
mod
txt
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Ee]xamples/.*".
  • 92 files match defined criteria (18,716 LOC, 20.1% vs. main code):
    • 38 *.yaml files (12,324 LOC)
    • 9 *.json files (4,001 LOC)
    • 38 *.md files (1,525 LOC)
    • 2 *.mod files (674 LOC)
    • 4 *.txt files (175 LOC)
    • 1 *.properties files (17 LOC)
  • " *.yaml" is biggest, containing 65.85% of LOC.
  • " *.properties" is smallest, containing 0.09% of LOC.


*.yaml12324 LOC (65%) 38 files
*.json4001 LOC (21%) 9 files
*.md1525 LOC (8%) 38 files
*.mod674 LOC (3%) 2 files
*.txt175 LOC (<1%) 4 files
*.properties17 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 19:57