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

main9461 LOC (52%) 136 files
test829 LOC (4%) 4 files
generated0 LOC (0%) 0 files
build and deployment2352 LOC (13%) 66 files
other5254 LOC (29%) 229 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 ".*".
  • 136 files match defined criteria (9,461 lines of code, 100.0% vs. main code):
    • 103 *.kt files (7,643 lines of code)
    • 33 *.java files (1,818 lines of code)
  • " *.kt" is biggest, containing 80.78% of code.
  • " *.java" is smallest, containing 19.22% of code.


*.kt7643 LOC (80%) 103 files
*.java1818 LOC (19%) 33 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 any line of content like ".*/simpletest/.*".
  • 4 files match defined criteria (829 lines of code, 8.8% vs. main code). All matches are in *.kt files.


*.kt829 LOC (100%) 4 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".
    • files with paths like ".*[.]sh".
  • 66 files match defined criteria (2,352 lines of code, 24.9% vs. main code):
    • 51 *.gradle files (1,422 lines of code)
    • 14 *.bat files (913 lines of code)
    • 1 *.sh files (17 lines of code)
  • " *.gradle" is biggest, containing 60.46% of code.
  • " *.sh" is smallest, containing 0.72% of code.


*.gradle1422 LOC (60%) 51 files
*.bat913 LOC (38%) 14 files
*.sh17 LOC (<1%) 1 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 ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 229 files match defined criteria (5,254 lines of code, 55.5% vs. main code):
    • 198 *.xml files (4,444 lines of code)
    • 17 *.md files (572 lines of code)
    • 14 *.properties files (238 lines of code)
  • " *.xml" is biggest, containing 84.58% of code.
  • " *.properties" is smallest, containing 4.53% of code.


*.xml4444 LOC (84%) 198 files
*.md572 LOC (10%) 17 files
*.properties238 LOC (4%) 14 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)


2022-02-03 05:24