awslabs / aws-sdk-android-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
  • 13 extensions are included in analyses: xml, java, json, gradle, properties, md, gitignore, kt, bat, pro, graphql, yml, txt
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (5 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (4 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (9 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 ".*[.]txt" (Text files) (0 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (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.

main1653 LOC (14%) 27 files
test58 LOC (<1%) 7 files
generated607 LOC (5%) 6 files
build and deployment609 LOC (5%) 17 files
other8413 LOC (74%) 146 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 ".*".
  • 27 files match defined criteria (1,653 lines of code, 100.0% vs. main code):
    • 21 *.java files (1,471 lines of code)
    • 4 *.kt files (134 lines of code)
    • 1 *.yml files (38 lines of code)
    • 1 *.graphql files (10 lines of code)
  • " *.java" is biggest, containing 88.99% of code.
  • " *.graphql" is smallest, containing 0.6% of code.


*.java1471 LOC (88%) 21 files
*.kt134 LOC (8%) 4 files
*.yml38 LOC (2%) 1 files
*.graphql10 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 ".*_test[.].*".
    • files with paths like ".*/src/androidTest/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 7 files match defined criteria (58 lines of code, 3.5% vs. main code):
    • 5 *.java files (35 lines of code)
    • 2 *.kt files (23 lines of code)
  • " *.java" is biggest, containing 60.34% of code.
  • " *.kt" is smallest, containing 39.66% of code.


*.java35 LOC (60%) 5 files
*.kt23 LOC (39%) 2 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/generated/.*".
  • 6 files match defined criteria (607 lines of code, 36.7% vs. main code):
    • 3 *.java files (326 lines of code)
    • 3 *.graphql files (281 lines of code)
  • " *.java" is biggest, containing 53.71% of code.
  • " *.graphql" is smallest, containing 46.29% of code.


*.java326 LOC (53%) 3 files
*.graphql281 LOC (46%) 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 ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 17 files match defined criteria (609 lines of code, 36.8% vs. main code):
    • 5 *.bat files (315 lines of code)
    • 12 *.gradle files (294 lines of code)
  • " *.bat" is biggest, containing 51.72% of code.
  • " *.gradle" is smallest, containing 48.28% of code.


*.bat315 LOC (51%) 5 files
*.gradle294 LOC (48%) 12 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 ".*[.]properties".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 146 files match defined criteria (8,413 lines of code, 509.0% vs. main code):
    • 12 *.json files (3,684 lines of code)
    • 110 *.xml files (2,742 lines of code)
    • 13 *.java files (1,396 lines of code)
    • 7 *.md files (542 lines of code)
    • 4 *.properties files (49 lines of code)
  • " *.json" is biggest, containing 43.79% of code.
  • " *.properties" is smallest, containing 0.58% of code.


*.json3684 LOC (43%) 12 files
*.xml2742 LOC (32%) 110 files
*.java1396 LOC (16%) 13 files
*.md542 LOC (6%) 7 files
*.properties49 LOC (<1%) 4 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)
  • *.yml files are analyzed with YamlAnalyzer:
    • 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
  • *.graphql 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


2022-01-31 18:04