opensearch-project / data-prepper
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
txt
tst
gitattributes
dockerignore
g4
  • 17 extensions are included in analyses: java, md, yml, yaml, gradle, json, sh, properties, py, txt, tst, bat, xml, gitattributes, dockerignore, gitignore, g4
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (17 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (19 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) (4 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.

main13355 LOC (32%) 247 files
test18320 LOC (44%) 225 files
generated0 LOC (0%) 0 files
build and deployment1785 LOC (4%) 42 files
other7652 LOC (18%) 127 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
g4
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 247 files match defined criteria (13,355 lines of code, 100.0% vs. main code):
    • 229 *.java files (12,743 lines of code)
    • 11 *.yaml files (426 lines of code)
    • 1 *.g4 files (95 lines of code)
    • 6 *.yml files (91 lines of code)
  • " *.java" is biggest, containing 95.42% of code.
  • " *.yml" is smallest, containing 0.68% of code.


*.java12743 LOC (95%) 229 files
*.yaml426 LOC (3%) 11 files
*.g495 LOC (<1%) 1 files
*.yml91 LOC (<1%) 6 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
tst
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 ".*_test[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 225 files match defined criteria (18,320 lines of code, 137.2% vs. main code):
    • 175 *.java files (17,569 lines of code)
    • 23 *.yml files (308 lines of code)
    • 20 *.yaml files (233 lines of code)
    • 2 *.sh files (166 lines of code)
    • 1 *.py files (24 lines of code)
    • 1 *.gradle files (14 lines of code)
    • 3 *.tst files (6 lines of code)
  • " *.java" is biggest, containing 95.9% of code.
  • " *.tst" is smallest, containing 0.03% of code.


*.java17569 LOC (95%) 175 files
*.yml308 LOC (1%) 23 files
*.yaml233 LOC (1%) 20 files
*.sh166 LOC (<1%) 2 files
*.py24 LOC (<1%) 1 files
*.gradle14 LOC (<1%) 1 files
*.tst6 LOC (<1%) 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 ".*[.]gradle".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/docker[-]compose[.]yaml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
  • 42 files match defined criteria (1,785 lines of code, 13.4% vs. main code):
    • 36 *.gradle files (1,510 lines of code)
    • 5 *.sh files (197 lines of code)
    • 1 *.bat files (78 lines of code)
  • " *.gradle" is biggest, containing 84.59% of code.
  • " *.bat" is smallest, containing 4.37% of code.


*.gradle1510 LOC (84%) 36 files
*.sh197 LOC (11%) 5 files
*.bat78 LOC (4%) 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 ".*[.]properties".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/config/checkstyle/.*".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 127 files match defined criteria (7,652 lines of code, 57.3% vs. main code):
    • 50 *.md files (3,024 lines of code)
    • 23 *.json files (1,843 lines of code)
    • 8 *.py files (1,013 lines of code)
    • 13 *.yml files (666 lines of code)
    • 11 *.yaml files (666 lines of code)
    • 8 *.properties files (120 lines of code)
    • 4 *.sh files (107 lines of code)
    • 5 *.java files (83 lines of code)
    • 1 *.bat files (78 lines of code)
    • 2 *.xml files (33 lines of code)
    • 2 *.gradle files (19 lines of code)
  • " *.md" is biggest, containing 39.52% of code.
  • " *.gradle" is smallest, containing 0.25% of code.


*.md3024 LOC (39%) 50 files
*.json1843 LOC (24%) 23 files
*.py1013 LOC (13%) 8 files
*.yml666 LOC (8%) 13 files
*.yaml666 LOC (8%) 11 files
*.properties120 LOC (1%) 8 files
*.sh107 LOC (1%) 4 files
*.java83 LOC (1%) 5 files
*.bat78 LOC (1%) 1 files
*.xml33 LOC (<1%) 2 files
*.gradle19 LOC (<1%) 2 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)
  • *.yaml 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
  • *.g4 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
  • *.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


2022-02-01 05:04