aws-samples / i-love-my-local-farmer
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
snap
txt
  • 17 extensions are included in analyses: java, md, xml, json, gitignore, sql, jsp, gradle, yaml, sh, yml, properties, bat, snap, ps1, psd1, txt
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (18 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (4 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.

main6193 LOC (44%) 101 files
test3174 LOC (22%) 21 files
generated0 LOC (0%) 0 files
build and deployment575 LOC (4%) 14 files
other4032 LOC (28%) 61 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 ".*".
  • 101 files match defined criteria (6,193 lines of code, 100.0% vs. main code):
    • 89 *.java files (5,451 lines of code)
    • 8 *.jsp files (378 lines of code)
    • 3 *.ps1 files (357 lines of code)
    • 1 *.psd1 files (7 lines of code)
  • " *.java" is biggest, containing 88.02% of code.
  • " *.psd1" is smallest, containing 0.11% of code.


*.java5451 LOC (88%) 89 files
*.jsp378 LOC (6%) 8 files
*.ps1357 LOC (5%) 3 files
*.psd17 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 ".*/[Tt]est/.*".
    • files with paths like ".*[.]snap".
    • files with any line of content like ".*/simpletest/.*".
  • 21 files match defined criteria (3,174 lines of code, 51.3% vs. main code):
    • 2 *.snap files (1,595 lines of code)
    • 19 *.java files (1,579 lines of code)
  • " *.snap" is biggest, containing 50.25% of code.
  • " *.java" is smallest, containing 49.75% of code.


*.snap1595 LOC (50%) 2 files
*.java1579 LOC (49%) 19 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 ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/pom[.]xml".
  • 14 files match defined criteria (575 lines of code, 9.3% vs. main code):
    • 8 *.gradle files (275 lines of code)
    • 4 *.bat files (265 lines of code)
    • 2 *.sh files (35 lines of code)
  • " *.gradle" is biggest, containing 47.83% of code.
  • " *.sh" is smallest, containing 6.09% of code.


*.gradle275 LOC (47%) 8 files
*.bat265 LOC (46%) 4 files
*.sh35 LOC (6%) 2 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 ".*[.]json".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*/config/checkstyle/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 61 files match defined criteria (4,032 lines of code, 65.1% vs. main code):
    • 13 *.xml files (1,807 lines of code)
    • 8 *.yaml files (814 lines of code)
    • 12 *.json files (601 lines of code)
    • 13 *.md files (440 lines of code)
    • 4 *.sh files (201 lines of code)
    • 10 *.sql files (164 lines of code)
    • 1 *.properties files (5 lines of code)
  • " *.xml" is biggest, containing 44.82% of code.
  • " *.properties" is smallest, containing 0.12% of code.


*.xml1807 LOC (44%) 13 files
*.yaml814 LOC (20%) 8 files
*.json601 LOC (14%) 12 files
*.md440 LOC (10%) 13 files
*.sh201 LOC (4%) 4 files
*.sql164 LOC (4%) 10 files
*.properties5 LOC (<1%) 1 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)
  • *.jsp files are analyzed with JspAnalyzer:
    • 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
  • *.ps1 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
  • *.psd1 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 17:11