facebookincubator / fbjni
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
properties
in
  • 15 extensions are included in analyses: h, cpp, java, md, gradle, txt, xml, yml, properties, in, gitignore, py, bat, sh, json
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (6 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 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).
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.

main5779 LOC (54%) 61 files
test4153 LOC (39%) 27 files
generated0 LOC (0%) 0 files
build and deployment196 LOC (1%) 8 files
other411 LOC (3%) 7 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 61 files match defined criteria (5,779 lines of code, 100.0% vs. main code):
    • 35 *.h files (4,009 lines of code)
    • 14 *.cpp files (1,511 lines of code)
    • 11 *.java files (242 lines of code)
    • 1 *.in files (17 lines of code)
  • " *.h" is biggest, containing 69.37% of code.
  • " *.in" is smallest, containing 0.29% of code.


*.h4009 LOC (69%) 35 files
*.cpp1511 LOC (26%) 14 files
*.java242 LOC (4%) 11 files
*.in17 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
  • 27 files match defined criteria (4,153 lines of code, 71.9% vs. main code):
    • 14 *.cpp files (2,480 lines of code)
    • 8 *.java files (1,653 lines of code)
    • 4 *.h files (16 lines of code)
    • 1 *.xml files (4 lines of code)
  • " *.cpp" is biggest, containing 59.72% of code.
  • " *.xml" is smallest, containing 0.1% of code.


*.cpp2480 LOC (59%) 14 files
*.java1653 LOC (39%) 8 files
*.h16 LOC (<1%) 4 files
*.xml4 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 ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
  • 8 files match defined criteria (196 lines of code, 3.4% vs. main code):
    • 5 *.gradle files (104 lines of code)
    • 1 *.bat files (76 lines of code)
    • 1 *.sh files (12 lines of code)
    • 1 *.xml files (4 lines of code)
  • " *.gradle" is biggest, containing 53.06% of code.
  • " *.xml" is smallest, containing 2.04% of code.


*.gradle104 LOC (53%) 5 files
*.bat76 LOC (38%) 1 files
*.sh12 LOC (6%) 1 files
*.xml4 LOC (2%) 1 files
Other Code
txt
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]gitignore".
  • 7 files match defined criteria (411 lines of code, 7.1% vs. main code):
    • 2 *.txt files (195 lines of code)
    • 3 *.md files (116 lines of code)
    • 1 *.json files (72 lines of code)
    • 1 *.properties files (28 lines of code)
  • " *.txt" is biggest, containing 47.45% of code.
  • " *.properties" is smallest, containing 6.81% of code.


*.txt195 LOC (47%) 2 files
*.md116 LOC (28%) 3 files
*.json72 LOC (17%) 1 files
*.properties28 LOC (6%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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)
  • *.in files are analyzed with RustAnalyzer:
    • 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


2022-04-15 05:01