elastic / ebpf
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
m4
mk
vcxproj
cfg
in
adb
patch
filters
mak
ld
tex
ads
com
cmakein
clang-format
l
y
mod
csproj
gitattributes
mms
builder
sas
s
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.

main153765 LOC (66%) 521 files
test46901 LOC (20%) 332 files
generated9561 LOC (4%) 3 files
build and deployment2392 LOC (1%) 58 files
other20157 LOC (8%) 214 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
y
adb
in
com
ads
ld
cmakein
filters
l
builder
sas
mms
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 521 files match defined criteria (153,765 LOC, 100.0% vs. main code):
    • 242 *.c files (85,859 LOC)
    • 161 *.h files (35,527 LOC)
    • 24 *.vcxproj files (10,062 LOC)
    • 17 *.cc files (8,867 LOC)
    • 8 *.py files (1,708 LOC)
    • 2 *.y files (1,665 LOC)
    • 6 *.adb files (1,186 LOC)
    • 4 *.pas files (1,016 LOC)
    • 10 *.in files (891 LOC)
    • 2 *.com files (882 LOC)
    • 3 *.ads files (715 LOC)
    • 2 *.cpp files (681 LOC)
    • 8 *.cs files (662 LOC)
    • 8 *.cmake files (626 LOC)
    • 4 *.ld files (603 LOC)
    • 1 *.inc files (527 LOC)
    • 2 *.go files (520 LOC)
    • 2 *.cmakein files (501 LOC)
    • 6 *.filters files (319 LOC)
    • 2 *.l files (314 LOC)
    • 1 *.css files (295 LOC)
    • 1 *.xml files (95 LOC)
    • 1 *.builder files (85 LOC)
    • 1 *.sas files (54 LOC)
    • 1 *.bash files (45 LOC)
    • 1 *.mms files (38 LOC)
    • 1 *.awk files (22 LOC)
  • " *.c" is biggest, containing 55.84% of LOC.
  • " *.awk" is smallest, containing 0.01% of LOC.


*.c85859 LOC (55%) 242 files
*.h35527 LOC (23%) 161 files
*.vcxproj10062 LOC (6%) 24 files
*.cc8867 LOC (5%) 17 files
*.py1708 LOC (1%) 8 files
*.y1665 LOC (1%) 2 files
*.adb1186 LOC (<1%) 6 files
*.pas1016 LOC (<1%) 4 files
*.in891 LOC (<1%) 10 files
*.com882 LOC (<1%) 2 files
*.ads715 LOC (<1%) 3 files
*.cpp681 LOC (<1%) 2 files
*.cs662 LOC (<1%) 8 files
*.cmake626 LOC (<1%) 8 files
*.ld603 LOC (<1%) 4 files
*.inc527 LOC (<1%) 1 file
*.go520 LOC (<1%) 2 files
*.cmakein501 LOC (<1%) 2 files
*.filters319 LOC (<1%) 6 files
*.l314 LOC (<1%) 2 files
*.css295 LOC (<1%) 1 file
*.xml95 LOC (<1%) 1 file
*.builder85 LOC (<1%) 1 file
*.sas54 LOC (<1%) 1 file
*.bash45 LOC (<1%) 1 file
*.mms38 LOC (<1%) 1 file
*.awk22 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
adb
mk
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 ".*[-]tests[-].*".
    • files with paths like ".*/testing[.].*".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*UnitTests[.][a-zA-Z0-9_]+".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*_tests[.].*".
  • 332 files match defined criteria (46,901 LOC, 30.5% vs. main code):
    • 73 *.cc files (28,734 LOC)
    • 56 *.c files (9,196 LOC)
    • 31 *.py files (3,424 LOC)
    • 115 *.sh files (2,578 LOC)
    • 13 *.h files (1,166 LOC)
    • 1 *.go files (672 LOC)
    • 20 *.yaml files (431 LOC)
    • 1 *.adb files (340 LOC)
    • 1 *.cs files (217 LOC)
    • 4 *.mk files (48 LOC)
    • 14 *.cfg files (33 LOC)
    • 2 *.cpp files (32 LOC)
    • 1 *.awk files (30 LOC)
  • " *.cc" is biggest, containing 61.27% of LOC.
  • " *.awk" is smallest, containing 0.06% of LOC.


*.cc28734 LOC (61%) 73 files
*.c9196 LOC (19%) 56 files
*.py3424 LOC (7%) 31 files
*.sh2578 LOC (5%) 115 files
*.h1166 LOC (2%) 13 files
*.go672 LOC (1%) 1 file
*.yaml431 LOC (<1%) 20 files
*.adb340 LOC (<1%) 1 file
*.cs217 LOC (<1%) 1 file
*.mk48 LOC (<1%) 4 files
*.cfg33 LOC (<1%) 14 files
*.cpp32 LOC (<1%) 2 files
*.awk30 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 paths like ".*[.](cxx|cpp|c|hxx|hpp|h)" AND any line of content like "[ ]*[*][ ]*Generated automatically by[ ]*.*".
  • 3 files match defined criteria (9,561 LOC, 6.2% vs. main code). All matches are in *.h files.


*.h9561 LOC (100%) 3 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
mak
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]mak".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]mk".
  • 58 files match defined criteria (2,392 LOC, 1.6% vs. main code):
    • 15 *.sh files (1,367 LOC)
    • 38 *.mk files (691 LOC)
    • 4 *.mak files (194 LOC)
    • 1 *.csproj files (140 LOC)
  • " *.sh" is biggest, containing 57.15% of LOC.
  • " *.csproj" is smallest, containing 5.85% of LOC.


*.sh1367 LOC (57%) 15 files
*.mk691 LOC (28%) 38 files
*.mak194 LOC (8%) 4 files
*.csproj140 LOC (5%) 1 file
Other Code
txt
tex
patch
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/go[.]mod".
  • 214 files match defined criteria (20,157 LOC, 13.1% vs. main code):
    • 152 *.txt files (11,605 LOC)
    • 15 *.c files (3,109 LOC)
    • 3 *.tex files (2,529 LOC)
    • 14 *.md files (1,197 LOC)
    • 13 *.cc files (600 LOC)
    • 1 *.html files (539 LOC)
    • 7 *.h files (202 LOC)
    • 6 *.patch files (201 LOC)
    • 2 *.rst files (167 LOC)
    • 1 *.mod files (8 LOC)
  • " *.txt" is biggest, containing 57.57% of LOC.
  • " *.mod" is smallest, containing 0.04% of LOC.


*.txt11605 LOC (57%) 152 files
*.c3109 LOC (15%) 15 files
*.tex2529 LOC (12%) 3 files
*.md1197 LOC (5%) 14 files
*.cc600 LOC (2%) 13 files
*.html539 LOC (2%) 1 file
*.h202 LOC (1%) 7 files
*.patch201 LOC (<1%) 6 files
*.rst167 LOC (<1%) 2 files
*.mod8 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 19:55