android / connectivity-samples
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
  • 16 extensions are included in analyses: xml, java, gradle, properties, kt, gitignore, md, bat, yaml, cpp, h, pro, txt, yml, sh, json
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (32 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (14 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (7 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).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (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.

main11597 LOC (63%) 99 files
test61 LOC (<1%) 4 files
generated0 LOC (0%) 0 files
build and deployment1630 LOC (8%) 57 files
other4888 LOC (26%) 216 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 ".*".
  • 99 files match defined criteria (11,597 lines of code, 100.0% vs. main code):
    • 56 *.java files (6,135 lines of code)
    • 11 *.cpp files (2,723 lines of code)
    • 8 *.h files (1,454 lines of code)
    • 24 *.kt files (1,285 lines of code)
  • " *.java" is biggest, containing 52.9% of code.
  • " *.kt" is smallest, containing 11.08% of code.


*.java6135 LOC (52%) 56 files
*.cpp2723 LOC (23%) 11 files
*.h1454 LOC (12%) 8 files
*.kt1285 LOC (11%) 24 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 ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 4 files match defined criteria (61 lines of code, 0.5% vs. main code):
    • 2 *.java files (38 lines of code)
    • 2 *.kt files (23 lines of code)
  • " *.java" is biggest, containing 62.3% of code.
  • " *.kt" is smallest, containing 37.7% of code.


*.java38 LOC (62%) 2 files
*.kt23 LOC (37%) 2 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]sh".
  • 57 files match defined criteria (1,630 lines of code, 14.1% vs. main code):
    • 14 *.bat files (894 lines of code)
    • 43 *.gradle files (736 lines of code)
  • " *.bat" is biggest, containing 54.85% of code.
  • " *.gradle" is smallest, containing 45.15% of code.


*.bat894 LOC (54%) 14 files
*.gradle736 LOC (45%) 43 files
Other Code
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 216 files match defined criteria (4,888 lines of code, 42.1% vs. main code):
    • 183 *.xml files (3,659 lines of code)
    • 15 *.md files (504 lines of code)
    • 4 *.java files (482 lines of code)
    • 14 *.properties files (243 lines of code)
  • " *.xml" is biggest, containing 74.86% of code.
  • " *.properties" is smallest, containing 4.97% of code.


*.xml3659 LOC (74%) 183 files
*.md504 LOC (10%) 15 files
*.java482 LOC (9%) 4 files
*.properties243 LOC (4%) 14 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)
  • *.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
  • *.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
  • *.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)


2022-02-03 05:25