facebook / fresco
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
mk
pro
txt
  • 23 extensions are included in analyses: java, html, xml, kt, gradle, md, properties, h, cpp, gitignore, mk, scss, js, yml, pro, css, c, svg, txt, py, bat, json, kts
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (26 files).
    • exclude files with path like ".*/cache/.*" (Caches) (149 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (12 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (823 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 files).
    • exclude files with path like ".*/[Jj]avadoc/.*" (Generated documentation) (0 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (0 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/proguard[.]pro" (ProGuard) (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.

main55817 LOC (53%) 744 files
test27056 LOC (26%) 184 files
generated0 LOC (0%) 0 files
build and deployment2359 LOC (2%) 105 files
other18319 LOC (17%) 372 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 ".*".
  • 744 files match defined criteria (55,817 lines of code, 100.0% vs. main code):
    • 592 *.java files (45,013 lines of code)
    • 73 *.kt files (4,501 lines of code)
    • 31 *.cpp files (3,824 lines of code)
    • 4 *.c files (1,136 lines of code)
    • 38 *.h files (939 lines of code)
    • 1 *.py files (234 lines of code)
    • 1 *.xml files (123 lines of code)
    • 3 *.pro files (41 lines of code)
    • 1 *.kts files (6 lines of code)
  • " *.java" is biggest, containing 80.64% of code.
  • " *.kts" is smallest, containing 0.01% of code.


*.java45013 LOC (80%) 592 files
*.kt4501 LOC (8%) 73 files
*.cpp3824 LOC (6%) 31 files
*.c1136 LOC (2%) 4 files
*.h939 LOC (1%) 38 files
*.py234 LOC (<1%) 1 files
*.xml123 LOC (<1%) 1 files
*.pro41 LOC (<1%) 3 files
*.kts6 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 ".*/src/androidTest/.*".
  • 184 files match defined criteria (27,056 lines of code, 48.5% vs. main code):
    • 183 *.java files (27,052 lines of code)
    • 1 *.xml files (4 lines of code)
  • " *.java" is biggest, containing 99.99% of code.
  • " *.xml" is smallest, containing 0.01% of code.


*.java27052 LOC (99%) 183 files
*.xml4 LOC (<1%) 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]mk".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*[.]bat".
  • 105 files match defined criteria (2,359 lines of code, 4.2% vs. main code):
    • 46 *.gradle files (1,713 lines of code)
    • 45 *.xml files (296 lines of code)
    • 13 *.mk files (274 lines of code)
    • 1 *.bat files (76 lines of code)
  • " *.gradle" is biggest, containing 72.62% of code.
  • " *.bat" is smallest, containing 3.22% of code.


*.gradle1713 LOC (72%) 46 files
*.xml296 LOC (12%) 45 files
*.mk274 LOC (11%) 13 files
*.bat76 LOC (3%) 1 files
Other Code
properties
pro
txt
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 ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
  • 372 files match defined criteria (18,319 lines of code, 32.8% vs. main code):
    • 167 *.java files (11,768 lines of code)
    • 108 *.xml files (3,523 lines of code)
    • 30 *.kt files (2,077 lines of code)
    • 7 *.gradle files (434 lines of code)
    • 49 *.properties files (236 lines of code)
    • 6 *.md files (156 lines of code)
    • 1 *.json files (72 lines of code)
    • 3 *.pro files (49 lines of code)
    • 1 *.txt files (4 lines of code)
  • " *.java" is biggest, containing 64.24% of code.
  • " *.txt" is smallest, containing 0.02% of code.


*.java11768 LOC (64%) 167 files
*.xml3523 LOC (19%) 108 files
*.kt2077 LOC (11%) 30 files
*.gradle434 LOC (2%) 7 files
*.properties236 LOC (1%) 49 files
*.md156 LOC (<1%) 6 files
*.json72 LOC (<1%) 1 files
*.pro49 LOC (<1%) 3 files
*.txt4 LOC (<1%) 1 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)
  • *.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)
  • *.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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.kts 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)


2022-04-14 23:01