elastic / beats
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
rl
properties
mod
editorconfig
mk
hcl
ini
04
spec
gitattributes
xsl
cfg
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.

main290932 LOC (25%) 3,169 files
test228202 LOC (20%) 1,671 files
generated1649 LOC (<1%) 5 files
build and deployment810 LOC (<1%) 54 files
other607274 LOC (53%) 3,122 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
rl
xsl
tpl
spec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 3169 files match defined criteria (290,932 LOC, 100.0% vs. main code):
    • 2,635 *.go files (265,139 LOC)
    • 407 *.asciidoc files (13,799 LOC)
    • 41 *.yaml files (5,297 LOC)
    • 13 *.js files (3,662 LOC)
    • 26 *.py files (1,022 LOC)
    • 22 *.tf files (909 LOC)
    • 15 *.rl files (766 LOC)
    • 1 *.xsl files (153 LOC)
    • 3 *.ts files (96 LOC)
    • 1 *.ps1 files (61 LOC)
    • 1 *.tpl files (22 LOC)
    • 1 *.xml files (3 LOC)
    • 1 *.toml files (1 LOC)
    • 1 *.spec files (1 LOC)
    • 1 *.sql files (1 LOC)
  • " *.go" is biggest, containing 91.13% of LOC.
  • " *.sql" is smallest, containing 0% of LOC.


*.go265139 LOC (91%) 2,635 files
*.asciidoc13799 LOC (4%) 407 files
*.yaml5297 LOC (1%) 41 files
*.js3662 LOC (1%) 13 files
*.py1022 LOC (<1%) 26 files
*.tf909 LOC (<1%) 22 files
*.rl766 LOC (<1%) 15 files
*.xsl153 LOC (<1%) 1 file
*.ts96 LOC (<1%) 3 files
*.ps161 LOC (<1%) 1 file
*.tpl22 LOC (<1%) 1 file
*.xml3 LOC (<1%) 1 file
*.toml1 LOC (<1%) 1 file
*.spec1 LOC (<1%) 1 file
*.sql1 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
04
cfg
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 ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/mock[a-zA-Z0-9_\- ]+/.*".
    • files with paths like ".*/testing[.].*".
    • files with paths like ".*_tests[.].*".
  • 1671 files match defined criteria (228,202 LOC, 78.4% vs. main code):
    • 1,459 *.go files (210,067 LOC)
    • 197 *.py files (17,585 LOC)
    • 3 *.thrift files (236 LOC)
    • 5 *.sh files (112 LOC)
    • 2 *.xml files (66 LOC)
    • 2 *.java files (60 LOC)
    • 1 *.04 files (31 LOC)
    • 1 *.asciidoc files (27 LOC)
    • 1 *.cfg files (18 LOC)
  • " *.go" is biggest, containing 92.05% of LOC.
  • " *.cfg" is smallest, containing 0.01% of LOC.


*.go210067 LOC (92%) 1,459 files
*.py17585 LOC (7%) 197 files
*.thrift236 LOC (<1%) 3 files
*.sh112 LOC (<1%) 5 files
*.xml66 LOC (<1%) 2 files
*.java60 LOC (<1%) 2 files
*.0431 LOC (<1%) 1 file
*.asciidoc27 LOC (<1%) 1 file
*.cfg18 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 .*".
    • files with paths like ".*/gen/.*[.]go".
    • files with paths like ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
  • 5 files match defined criteria (1,649 LOC, 0.6% vs. main code):
    • 1 *.html files (1,100 LOC)
    • 4 *.go files (549 LOC)
  • " *.html" is biggest, containing 66.71% of LOC.
  • " *.go" is smallest, containing 33.29% of LOC.


*.html1100 LOC (66%) 1 file
*.go549 LOC (33%) 4 files
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 ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]mk".
  • 54 files match defined criteria (810 LOC, 0.3% vs. main code):
    • 41 *.sh files (650 LOC)
    • 11 *.bat files (88 LOC)
    • 2 *.mk files (72 LOC)
  • " *.sh" is biggest, containing 80.25% of LOC.
  • " *.mk" is smallest, containing 8.89% of LOC.


*.sh650 LOC (80%) 41 files
*.bat88 LOC (10%) 11 files
*.mk72 LOC (8%) 2 files
Other Code
txt
mod
ini
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/go[.]mod".
  • 3122 files match defined criteria (607,274 LOC, 208.7% vs. main code):
    • 2,996 *.json files (600,081 LOC)
    • 95 *.md files (4,192 LOC)
    • 23 *.txt files (2,400 LOC)
    • 1 *.mod files (501 LOC)
    • 2 *.go files (73 LOC)
    • 2 *.ini files (20 LOC)
    • 3 *.properties files (7 LOC)
  • " *.json" is biggest, containing 98.82% of LOC.
  • " *.properties" is smallest, containing 0% of LOC.


*.json600081 LOC (98%) 2,996 files
*.md4192 LOC (<1%) 95 files
*.txt2400 LOC (<1%) 23 files
*.mod501 LOC (<1%) 1 file
*.go73 LOC (<1%) 2 files
*.ini20 LOC (<1%) 2 files
*.properties7 LOC (<1%) 3 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 19:40