firebase / firebase-android-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
pb
txt
properties
proto
mk
pro
cfg
gitmodules
  • 24 extensions are included in analyses: java, pb, xml, txt, gradle, kt, properties, md, json, proto, py, h, mk, cpp, gitignore, pro, js, mustache, yml, bat, sh, yaml, cfg, gitmodules
  • 10 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (17 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (2 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (1 file).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (4 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (11 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) (129 files).
    • 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.

main120598 LOC (2%) 1422 files
test5230733 LOC (92%) 983 files
generated2436 LOC (<1%) 1 files
build and deployment4454 LOC (<1%) 109 files
other312682 LOC (5%) 348 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
cfg
pro
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1422 files match defined criteria (120,598 lines of code, 100.0% vs. main code):
    • 1,307 *.java files (111,578 lines of code)
    • 26 *.proto files (4,103 lines of code)
    • 38 *.kt files (2,560 lines of code)
    • 20 *.h files (810 lines of code)
    • 17 *.py files (735 lines of code)
    • 8 *.cpp files (610 lines of code)
    • 2 *.mustache files (75 lines of code)
    • 1 *.cfg files (73 lines of code)
    • 1 *.yaml files (52 lines of code)
    • 2 *.pro files (2 lines of code)
  • " *.java" is biggest, containing 92.52% of code.
  • " *.pro" is smallest, containing 0% of code.


*.java111578 LOC (92%) 1307 files
*.proto4103 LOC (3%) 26 files
*.kt2560 LOC (2%) 38 files
*.h810 LOC (<1%) 20 files
*.py735 LOC (<1%) 17 files
*.cpp610 LOC (<1%) 8 files
*.mustache75 LOC (<1%) 2 files
*.cfg73 LOC (<1%) 1 files
*.yaml52 LOC (<1%) 1 files
*.pro2 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
pb
proto
pro
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/src/androidTest/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 983 files match defined criteria (5,230,733 lines of code, 4337.3% vs. main code):
    • 272 *.pb files (5,110,788 lines of code)
    • 647 *.java files (114,952 lines of code)
    • 34 *.kt files (3,167 lines of code)
    • 10 *.proto files (636 lines of code)
    • 1 *.h files (507 lines of code)
    • 7 *.py files (284 lines of code)
    • 6 *.gradle files (207 lines of code)
    • 2 *.js files (105 lines of code)
    • 1 *.mustache files (48 lines of code)
    • 2 *.pro files (27 lines of code)
    • 1 *.cpp files (12 lines of code)
  • " *.pb" is biggest, containing 97.71% of code.
  • " *.cpp" is smallest, containing 0% of code.


*.pb5110788 LOC (97%) 272 files
*.java114952 LOC (2%) 647 files
*.kt3167 LOC (<1%) 34 files
*.proto636 LOC (<1%) 10 files
*.h507 LOC (<1%) 1 files
*.py284 LOC (<1%) 7 files
*.gradle207 LOC (<1%) 6 files
*.js105 LOC (<1%) 2 files
*.mustache48 LOC (<1%) 1 files
*.pro27 LOC (<1%) 2 files
*.cpp12 LOC (<1%) 1 files
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".
  • 1 file matches defined criteria (2,436 lines of code, 2.0% vs. main code). All matches are in *.json files.


*.json2436 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]mk".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitmodules".
  • 109 files match defined criteria (4,454 lines of code, 3.7% vs. main code):
    • 90 *.gradle files (3,811 lines of code)
    • 15 *.mk files (467 lines of code)
    • 2 *.bat files (152 lines of code)
    • 2 *.sh files (24 lines of code)
  • " *.gradle" is biggest, containing 85.56% of code.
  • " *.sh" is smallest, containing 0.54% of code.


*.gradle3811 LOC (85%) 90 files
*.mk467 LOC (10%) 15 files
*.bat152 LOC (3%) 2 files
*.sh24 LOC (<1%) 2 files
Other Code
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • 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 ".*[.]properties".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 348 files match defined criteria (312,682 lines of code, 259.3% vs. main code):
    • 34 *.json files (305,856 lines of code)
    • 217 *.xml files (4,640 lines of code)
    • 36 *.md files (1,778 lines of code)
    • 61 *.properties files (408 lines of code)
  • " *.json" is biggest, containing 97.82% of code.
  • " *.properties" is smallest, containing 0.13% of code.


*.json305856 LOC (97%) 34 files
*.xml4640 LOC (1%) 217 files
*.md1778 LOC (<1%) 36 files
*.properties408 LOC (<1%) 61 files
Analyzers
Info about analyzers used for source code examinations.
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.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
  • *.kt files are analyzed with KotlinAnalyzer:
    • 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
    • Basic heuristic dependency analysis (based on imports and package statements)
  • *.h files are analyzed with CppAnalyzer:
    • 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
  • *.py files are analyzed with PythonAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.cpp files are analyzed with CppAnalyzer:
    • 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
  • *.mustache 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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.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
  • *.pro 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


2022-02-03 05:39