firebase / firebase-js-sdk
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
proto
hbs
npmignore
txt
snap
gitattributes
editorconfig
prettierignore
  • 19 extensions are included in analyses: ts, json, js, md, yml, proto, html, xml, gitignore, hbs, css, npmignore, sh, yaml, txt, snap, gitattributes, editorconfig, prettierignore
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (95 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (61 files).
    • exclude files with path like ".*/cordova([^.]*)\.js" (PhoneGap/Cordova) (3 files).
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (1 file).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (0 files).
    • exclude files with path like ".*[.]txt" (Text files) (1 file).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
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.

main89086 LOC (43%) 969 files
test94157 LOC (45%) 573 files
generated0 LOC (0%) 0 files
build and deployment98 LOC (<1%) 3 files
other22907 LOC (11%) 359 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
hbs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 969 files match defined criteria (89,086 lines of code, 100.0% vs. main code):
    • 872 *.ts files (80,284 lines of code)
    • 67 *.js files (4,566 lines of code)
    • 18 *.proto files (3,450 lines of code)
    • 2 *.yaml files (480 lines of code)
    • 8 *.hbs files (209 lines of code)
    • 1 *.css files (54 lines of code)
    • 1 *.html files (43 lines of code)
  • " *.ts" is biggest, containing 90.12% of code.
  • " *.html" is smallest, containing 0.05% of code.


*.ts80284 LOC (90%) 872 files
*.js4566 LOC (5%) 67 files
*.proto3450 LOC (3%) 18 files
*.yaml480 LOC (<1%) 2 files
*.hbs209 LOC (<1%) 8 files
*.css54 LOC (<1%) 1 files
*.html43 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
snap
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/karma[.]conf[.]js".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[.]snap".
    • files with any line of content like ".*/simpletest/.*".
  • 573 files match defined criteria (94,157 lines of code, 105.7% vs. main code):
    • 473 *.ts files (90,858 lines of code)
    • 87 *.js files (2,932 lines of code)
    • 10 *.html files (284 lines of code)
    • 2 *.snap files (73 lines of code)
    • 1 *.sh files (10 lines of code)
  • " *.ts" is biggest, containing 96.5% of code.
  • " *.sh" is smallest, containing 0.01% of code.


*.ts90858 LOC (96%) 473 files
*.js2932 LOC (3%) 87 files
*.html284 LOC (<1%) 10 files
*.snap73 LOC (<1%) 2 files
*.sh10 LOC (<1%) 1 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 ".*[.]sh".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/[.]gitattributes".
  • 3 files match defined criteria (98 lines of code, 0.1% vs. main code):
    • 2 *.sh files (50 lines of code)
    • 1 *.ts files (48 lines of code)
  • " *.sh" is biggest, containing 51.02% of code.
  • " *.ts" is smallest, containing 48.98% of code.


*.sh50 LOC (51%) 2 files
*.ts48 LOC (48%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • 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 ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 359 files match defined criteria (22,907 lines of code, 25.7% vs. main code):
    • 214 *.json files (9,700 lines of code)
    • 124 *.md files (7,443 lines of code)
    • 12 *.js files (3,034 lines of code)
    • 3 *.html files (2,015 lines of code)
    • 3 *.css files (468 lines of code)
    • 2 *.ts files (231 lines of code)
    • 1 *.xml files (16 lines of code)
  • " *.json" is biggest, containing 42.35% of code.
  • " *.xml" is smallest, containing 0.07% of code.


*.json9700 LOC (42%) 214 files
*.md7443 LOC (32%) 124 files
*.js3034 LOC (13%) 12 files
*.html2015 LOC (8%) 3 files
*.css468 LOC (2%) 3 files
*.ts231 LOC (1%) 2 files
*.xml16 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.js files are analyzed with JavaScriptAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.proto files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.yaml files are analyzed with YamlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.hbs files are analyzed with HtmlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis
  • *.css files are analyzed with CssAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.html files are analyzed with HtmlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis


2022-02-03 05:37