facebook / facebook-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
pro
txt
properties
  • 13 extensions are included in analyses: kt, xml, java, gradle, pro, md, gitignore, txt, yml, properties, sh, bat, json
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (10 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (16 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (3 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.

main42222 LOC (55%) 469 files
test26262 LOC (34%) 251 files
generated0 LOC (0%) 0 files
build and deployment1032 LOC (1%) 28 files
other6846 LOC (8%) 136 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 469 files match defined criteria (42,222 lines of code, 100.0% vs. main code):
    • 279 *.kt files (31,943 lines of code)
    • 61 *.java files (7,108 lines of code)
    • 129 *.xml files (3,171 lines of code)
  • " *.kt" is biggest, containing 75.65% of code.
  • " *.xml" is smallest, containing 7.51% of code.


*.kt31943 LOC (75%) 279 files
*.java7108 LOC (16%) 61 files
*.xml3171 LOC (7%) 129 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/.*".
    • files with paths like ".*_tests[.].*".
  • 251 files match defined criteria (26,262 lines of code, 62.2% vs. main code):
    • 223 *.kt files (24,367 lines of code)
    • 20 *.java files (1,812 lines of code)
    • 7 *.xml files (62 lines of code)
    • 1 *.sh files (21 lines of code)
  • " *.kt" is biggest, containing 92.78% of code.
  • " *.sh" is smallest, containing 0.08% of code.


*.kt24367 LOC (92%) 223 files
*.java1812 LOC (6%) 20 files
*.xml62 LOC (<1%) 7 files
*.sh21 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 ".*[.]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".
  • 28 files match defined criteria (1,032 lines of code, 2.4% vs. main code):
    • 14 *.gradle files (789 lines of code)
    • 10 *.xml files (93 lines of code)
    • 3 *.sh files (84 lines of code)
    • 1 *.bat files (66 lines of code)
  • " *.gradle" is biggest, containing 76.45% of code.
  • " *.bat" is smallest, containing 6.4% of code.


*.gradle789 LOC (76%) 14 files
*.xml93 LOC (9%) 10 files
*.sh84 LOC (8%) 3 files
*.bat66 LOC (6%) 1 files
Other Code
txt
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 136 files match defined criteria (6,846 lines of code, 16.2% vs. main code):
    • 42 *.java files (3,450 lines of code)
    • 54 *.xml files (1,535 lines of code)
    • 9 *.md files (540 lines of code)
    • 11 *.kt files (509 lines of code)
    • 8 *.gradle files (328 lines of code)
    • 7 *.txt files (314 lines of code)
    • 1 *.sh files (89 lines of code)
    • 1 *.json files (72 lines of code)
    • 3 *.properties files (9 lines of code)
  • " *.java" is biggest, containing 50.39% of code.
  • " *.properties" is smallest, containing 0.13% of code.


*.java3450 LOC (50%) 42 files
*.xml1535 LOC (22%) 54 files
*.md540 LOC (7%) 9 files
*.kt509 LOC (7%) 11 files
*.gradle328 LOC (4%) 8 files
*.txt314 LOC (4%) 7 files
*.sh89 LOC (1%) 1 files
*.json72 LOC (1%) 1 files
*.properties9 LOC (<1%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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


2022-04-14 22:40