facebook / stetho
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
properties
pro
txt
  • 14 extensions are included in analyses: java, xml, gradle, gitignore, properties, md, pro, json, py, js, txt, bat, sh, yml
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (12 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • 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.

main17776 LOC (70%) 261 files
test1316 LOC (5%) 11 files
generated0 LOC (0%) 0 files
build and deployment482 LOC (1%) 20 files
other5724 LOC (22%) 15 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
pro
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 261 files match defined criteria (17,776 lines of code, 100.0% vs. main code):
    • 247 *.java files (17,124 lines of code)
    • 10 *.xml files (253 lines of code)
    • 1 *.js files (242 lines of code)
    • 1 *.py files (134 lines of code)
    • 2 *.pro files (23 lines of code)
  • " *.java" is biggest, containing 96.33% of code.
  • " *.pro" is smallest, containing 0.13% of code.


*.java17124 LOC (96%) 247 files
*.xml253 LOC (1%) 10 files
*.js242 LOC (1%) 1 files
*.py134 LOC (<1%) 1 files
*.pro23 LOC (<1%) 2 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/.*".
  • 11 files match defined criteria (1,316 lines of code, 7.4% vs. main code). All matches are in *.java files.


*.java1316 LOC (100%) 11 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
  • 20 files match defined criteria (482 lines of code, 2.7% vs. main code):
    • 10 *.gradle files (331 lines of code)
    • 8 *.xml files (75 lines of code)
    • 1 *.bat files (61 lines of code)
    • 1 *.sh files (15 lines of code)
  • " *.gradle" is biggest, containing 68.67% of code.
  • " *.sh" is smallest, containing 3.11% of code.


*.gradle331 LOC (68%) 10 files
*.xml75 LOC (15%) 8 files
*.bat61 LOC (12%) 1 files
*.sh15 LOC (3%) 1 files
Other Code
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
  • 15 files match defined criteria (5,724 lines of code, 32.2% vs. main code):
    • 2 *.json files (5,155 lines of code)
    • 6 *.md files (527 lines of code)
    • 7 *.properties files (42 lines of code)
  • " *.json" is biggest, containing 90.06% of code.
  • " *.properties" is smallest, containing 0.73% of code.


*.json5155 LOC (90%) 2 files
*.md527 LOC (9%) 6 files
*.properties42 LOC (<1%) 7 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)
  • *.xml files are analyzed with XmlAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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-04-14 22:59