facebook / screenshot-tests-for-android
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
txt
  • 14 extensions are included in analyses: java, xml, py, kt, gradle, properties, json, gitignore, md, css, js, txt, groovy, bat
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 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.

main4139 LOC (56%) 61 files
test2260 LOC (31%) 33 files
generated0 LOC (0%) 0 files
build and deployment461 LOC (6%) 14 files
other426 LOC (5%) 13 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 ".*".
  • 61 files match defined criteria (4,139 lines of code, 100.0% vs. main code):
    • 27 *.java files (2,382 lines of code)
    • 11 *.py files (909 lines of code)
    • 11 *.kt files (393 lines of code)
    • 10 *.xml files (296 lines of code)
    • 1 *.css files (122 lines of code)
    • 1 *.js files (37 lines of code)
  • " *.java" is biggest, containing 57.55% of code.
  • " *.js" is smallest, containing 0.89% of code.


*.java2382 LOC (57%) 27 files
*.py909 LOC (21%) 11 files
*.kt393 LOC (9%) 11 files
*.xml296 LOC (7%) 10 files
*.css122 LOC (2%) 1 files
*.js37 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 ".*/src/androidTest/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
  • 33 files match defined criteria (2,260 lines of code, 54.6% vs. main code):
    • 18 *.java files (1,282 lines of code)
    • 7 *.py files (711 lines of code)
    • 4 *.kt files (152 lines of code)
    • 1 *.groovy files (65 lines of code)
    • 3 *.xml files (50 lines of code)
  • " *.java" is biggest, containing 56.73% of code.
  • " *.xml" is smallest, containing 2.21% of code.


*.java1282 LOC (56%) 18 files
*.py711 LOC (31%) 7 files
*.kt152 LOC (6%) 4 files
*.groovy65 LOC (2%) 1 files
*.xml50 LOC (2%) 3 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 ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]bat".
  • 14 files match defined criteria (461 lines of code, 11.1% vs. main code):
    • 8 *.gradle files (337 lines of code)
    • 1 *.bat files (78 lines of code)
    • 5 *.xml files (46 lines of code)
  • " *.gradle" is biggest, containing 73.1% of code.
  • " *.xml" is smallest, containing 9.98% of code.


*.gradle337 LOC (73%) 8 files
*.bat78 LOC (16%) 1 files
*.xml46 LOC (9%) 5 files
Other Code
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
  • 13 files match defined criteria (426 lines of code, 10.3% vs. main code):
    • 5 *.json files (237 lines of code)
    • 2 *.md files (157 lines of code)
    • 6 *.properties files (32 lines of code)
  • " *.json" is biggest, containing 55.63% of code.
  • " *.properties" is smallest, containing 7.51% of code.


*.json237 LOC (55%) 5 files
*.md157 LOC (36%) 2 files
*.properties32 LOC (7%) 6 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)
  • *.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
  • *.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)
  • *.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
  • *.css files are analyzed with CssAnalyzer:
    • 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


2022-04-14 23:05