aws-samples / aws-amplify-react-native-events-app-workshop
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
ipp
txt
plist
in
m4
properties
patch
adoc
pro
storyboard
snap
  • 29 extensions are included in analyses: hpp, h, ipp, json, m, cpp, js, cc, md, txt, plist, xml, in, sh, java, bat, m4, gradle, pl, gitignore, properties, patch, xib, bzl, markdown, adoc, pro, storyboard, snap
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (3 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (1 file).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (45 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (3 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) (6 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.

main1649 LOC (<1%) 26 files
test20 LOC (<1%) 2 files
generated1656851 LOC (99%) 12780 files
build and deployment207 LOC (<1%) 5 files
other5063 LOC (<1%) 91 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 ".*".
  • 26 files match defined criteria (1,649 lines of code, 100.0% vs. main code):
    • 19 *.js files (1,350 lines of code)
    • 3 *.java files (181 lines of code)
    • 2 *.m files (94 lines of code)
    • 1 *.bzl files (17 lines of code)
    • 1 *.h files (7 lines of code)
  • " *.js" is biggest, containing 81.87% of code.
  • " *.h" is smallest, containing 0.42% of code.


*.js1350 LOC (81%) 19 files
*.java181 LOC (10%) 3 files
*.m94 LOC (5%) 2 files
*.bzl17 LOC (1%) 1 files
*.h7 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
snap
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/mock[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 2 files match defined criteria (20 lines of code, 1.2% vs. main code):
    • 1 *.snap files (15 lines of code)
    • 1 *.js files (5 lines of code)
  • " *.snap" is biggest, containing 75% of code.
  • " *.js" is smallest, containing 25% of code.


*.snap15 LOC (75%) 1 files
*.js5 LOC (25%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
ipp
in
plist
patch
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/Pods/.*".
  • 12780 files match defined criteria (1,656,851 lines of code, 100476.1% vs. main code):
    • 11,996 *.hpp files (1,545,178 lines of code)
    • 444 *.h files (58,613 lines of code)
    • 173 *.ipp files (35,990 lines of code)
    • 15 *.cc files (6,345 lines of code)
    • 33 *.cpp files (5,715 lines of code)
    • 55 *.json files (1,869 lines of code)
    • 6 *.in files (1,250 lines of code)
    • 3 *.plist files (798 lines of code)
    • 1 *.markdown files (360 lines of code)
    • 2 *.md files (218 lines of code)
    • 43 *.m files (215 lines of code)
    • 3 *.pl files (141 lines of code)
    • 3 *.sh files (114 lines of code)
    • 2 *.bat files (39 lines of code)
    • 1 *.patch files (6 lines of code)
  • " *.hpp" is biggest, containing 93.26% of code.
  • " *.patch" is smallest, containing 0% of code.


*.hpp1545178 LOC (93%) 11996 files
*.h58613 LOC (3%) 444 files
*.ipp35990 LOC (2%) 173 files
*.cc6345 LOC (<1%) 15 files
*.cpp5715 LOC (<1%) 33 files
*.json1869 LOC (<1%) 55 files
*.in1250 LOC (<1%) 6 files
*.plist798 LOC (<1%) 3 files
*.markdown360 LOC (<1%) 1 files
*.md218 LOC (<1%) 2 files
*.m215 LOC (<1%) 43 files
*.pl141 LOC (<1%) 3 files
*.sh114 LOC (<1%) 3 files
*.bat39 LOC (<1%) 2 files
*.patch6 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 ".*/package[.]json".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 5 files match defined criteria (207 lines of code, 12.6% vs. main code):
    • 3 *.gradle files (126 lines of code)
    • 1 *.bat files (78 lines of code)
    • 1 *.sh files (3 lines of code)
  • " *.gradle" is biggest, containing 60.87% of code.
  • " *.sh" is smallest, containing 1.45% of code.


*.gradle126 LOC (60%) 3 files
*.bat78 LOC (37%) 1 files
*.sh3 LOC (1%) 1 files
Other Code
plist
storyboard
properties
adoc
patch
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 ".*[.]json".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]markdown".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 91 files match defined criteria (5,063 lines of code, 307.0% vs. main code):
    • 62 *.json files (2,312 lines of code)
    • 11 *.md files (1,270 lines of code)
    • 6 *.plist files (875 lines of code)
    • 1 *.markdown files (360 lines of code)
    • 1 *.storyboard files (90 lines of code)
    • 6 *.xml files (70 lines of code)
    • 1 *.xib files (42 lines of code)
    • 1 *.properties files (22 lines of code)
    • 1 *.adoc files (16 lines of code)
    • 1 *.patch files (6 lines of code)
  • " *.json" is biggest, containing 45.66% of code.
  • " *.patch" is smallest, containing 0.12% of code.


*.json2312 LOC (45%) 62 files
*.md1270 LOC (25%) 11 files
*.plist875 LOC (17%) 6 files
*.markdown360 LOC (7%) 1 files
*.storyboard90 LOC (1%) 1 files
*.xml70 LOC (1%) 6 files
*.xib42 LOC (<1%) 1 files
*.properties22 LOC (<1%) 1 files
*.adoc16 LOC (<1%) 1 files
*.patch6 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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)
  • *.m 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
  • *.bzl 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
  • *.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


2022-01-31 15:54