elastic / cloudbeat
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
rego
txt
mod
hcl
editorconfig
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.

main66420 LOC (53%) 1,184 files
test48224 LOC (38%) 597 files
generated0 LOC (0%) 0 files
build and deployment1292 LOC (1%) 29 files
other7730 LOC (6%) 55 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
rego
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1184 files match defined criteria (66,420 LOC, 100.0% vs. main code):
    • 378 *.go files (36,543 LOC)
    • 324 *.yaml files (20,117 LOC)
    • 428 *.rego files (6,742 LOC)
    • 42 *.tf files (1,600 LOC)
    • 8 *.py files (1,328 LOC)
    • 1 *.bash files (50 LOC)
    • 2 *.toml files (32 LOC)
    • 1 *.cfg files (8 LOC)
  • " *.go" is biggest, containing 55.02% of LOC.
  • " *.cfg" is smallest, containing 0.01% of LOC.


*.go36543 LOC (55%) 378 files
*.yaml20117 LOC (30%) 324 files
*.rego6742 LOC (10%) 428 files
*.tf1600 LOC (2%) 42 files
*.py1328 LOC (1%) 8 files
*.bash50 LOC (<1%) 1 file
*.toml32 LOC (<1%) 2 files
*.cfg8 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
rego
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*/test[.].*".
  • 597 files match defined criteria (48,224 LOC, 72.6% vs. main code):
    • 141 *.go files (24,402 LOC)
    • 334 *.rego files (13,886 LOC)
    • 112 *.py files (9,118 LOC)
    • 8 *.yaml files (699 LOC)
    • 1 *.toml files (78 LOC)
    • 1 *.tpl files (41 LOC)
  • " *.go" is biggest, containing 50.6% of LOC.
  • " *.tpl" is smallest, containing 0.09% of LOC.


*.go24402 LOC (50%) 141 files
*.rego13886 LOC (28%) 334 files
*.py9118 LOC (18%) 112 files
*.yaml699 LOC (1%) 8 files
*.toml78 LOC (<1%) 1 file
*.tpl41 LOC (<1%) 1 file
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".
  • 29 files match defined criteria (1,292 LOC, 1.9% vs. main code). All matches are in *.sh files.


*.sh1292 LOC (100%) 29 files
Other Code
mod
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/go[.]mod".
  • 55 files match defined criteria (7,730 LOC, 11.6% vs. main code):
    • 19 *.json files (4,229 LOC)
    • 23 *.md files (2,356 LOC)
    • 2 *.mod files (594 LOC)
    • 11 *.txt files (551 LOC)
  • " *.json" is biggest, containing 54.71% of LOC.
  • " *.txt" is smallest, containing 7.13% of LOC.


*.json4229 LOC (54%) 19 files
*.md2356 LOC (30%) 23 files
*.mod594 LOC (7%) 2 files
*.txt551 LOC (7%) 11 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 19:58