mozilla / addons-blog
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
njk
txt
npmrc
eslintignore
prettierignore
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.

main1758 LOC (38%) 38 files
test2162 LOC (47%) 22 files
generated0 LOC (0%) 0 files
build and deployment0 LOC (0%) 0 files
other613 LOC (13%) 11 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
njk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 38 files match defined criteria (1,758 LOC, 100.0% vs. main code):
    • 13 *.js files (754 LOC)
    • 10 *.scss files (609 LOC)
    • 15 *.njk files (395 LOC)
  • " *.js" is biggest, containing 42.89% of LOC.
  • " *.njk" is smallest, containing 22.47% of LOC.


*.js754 LOC (42%) 13 files
*.scss609 LOC (34%) 10 files
*.njk395 LOC (22%) 15 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
njk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/jest[.][a-zA-Z0-9\.]+".
  • 22 files match defined criteria (2,162 LOC, 123.0% vs. main code):
    • 15 *.js files (1,909 LOC)
    • 3 *.php files (220 LOC)
    • 1 *.html files (15 LOC)
    • 1 *.css files (10 LOC)
    • 2 *.njk files (8 LOC)
  • " *.js" is biggest, containing 88.3% of LOC.
  • " *.njk" is smallest, containing 0.37% of LOC.


*.js1909 LOC (88%) 15 files
*.php220 LOC (10%) 3 files
*.html15 LOC (<1%) 1 file
*.css10 LOC (<1%) 1 file
*.njk8 LOC (<1%) 2 files
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[.]prettierignore".
  • 11 files match defined criteria (613 LOC, 34.9% vs. main code):
    • 4 *.txt files (297 LOC)
    • 3 *.json files (206 LOC)
    • 2 *.md files (106 LOC)
    • 2 *.svg files (4 LOC)
  • " *.txt" is biggest, containing 48.45% of LOC.
  • " *.svg" is smallest, containing 0.65% of LOC.


*.txt297 LOC (48%) 4 files
*.json206 LOC (33%) 3 files
*.md106 LOC (17%) 2 files
*.svg4 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-11 19:53