elastic / apm-agent-nodejs
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
mjs
npmrc
txt
gitattributes
editorconfig
babelrc
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.

main18939 LOC (22%) 147 files
test52060 LOC (60%) 372 files
generated1940 LOC (2%) 5 files
build and deployment206 LOC (<1%) 5 files
other12467 LOC (14%) 135 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
mjs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 147 files match defined criteria (18,939 LOC, 100.0% vs. main code):
    • 145 *.js files (18,913 LOC)
    • 1 *.yaml files (20 LOC)
    • 1 *.mjs files (6 LOC)
  • " *.js" is biggest, containing 99.86% of LOC.
  • " *.mjs" is smallest, containing 0.03% of LOC.


*.js18913 LOC (99%) 145 files
*.yaml20 LOC (<1%) 1 file
*.mjs6 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
mjs
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 ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*_tests[.].*".
  • 372 files match defined criteria (52,060 LOC, 274.9% vs. main code):
    • 338 *.js files (50,791 LOC)
    • 18 *.mjs files (701 LOC)
    • 8 *.sh files (328 LOC)
    • 6 *.ts files (230 LOC)
    • 1 *.cjs files (7 LOC)
    • 1 *.css files (3 LOC)
  • " *.js" is biggest, containing 97.56% of LOC.
  • " *.css" is smallest, containing 0.01% of LOC.


*.js50791 LOC (97%) 338 files
*.mjs701 LOC (1%) 18 files
*.sh328 LOC (<1%) 8 files
*.ts230 LOC (<1%) 6 files
*.cjs7 LOC (<1%) 1 file
*.css3 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 ".*/package[-]lock[.]json".
  • 5 files match defined criteria (1,940 LOC, 10.2% vs. main code). All matches are in *.json files.


*.json1940 LOC (100%) 5 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 ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/package[-]lock[.]json".
  • 5 files match defined criteria (206 LOC, 1.1% vs. main code). All matches are in *.sh files.


*.sh206 LOC (100%) 5 files
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]txt".
  • 135 files match defined criteria (12,467 LOC, 65.8% vs. main code):
    • 66 *.json files (8,729 LOC)
    • 24 *.md files (1,966 LOC)
    • 39 *.js files (1,569 LOC)
    • 2 *.css files (135 LOC)
    • 2 *.txt files (34 LOC)
    • 1 *.ts files (30 LOC)
    • 1 *.svg files (4 LOC)
  • " *.json" is biggest, containing 70.02% of LOC.
  • " *.svg" is smallest, containing 0.03% of LOC.


*.json8729 LOC (70%) 66 files
*.md1966 LOC (15%) 24 files
*.js1569 LOC (12%) 39 files
*.css135 LOC (1%) 2 files
*.txt34 LOC (<1%) 2 files
*.ts30 LOC (<1%) 1 file
*.svg4 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 19:42