opensearch-project / dashboards-notebooks
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
txt
editorconfig
properties
policy
  • 17 extensions are included in analyses: kt, md, ts, tsx, yml, json, js, gradle, xml, gitignore, scss, txt, java, bat, editorconfig, properties, policy
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (1 file).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (20 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (8 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.

main8652 LOC (79%) 83 files
test1143 LOC (10%) 10 files
generated0 LOC (0%) 0 files
build and deployment376 LOC (3%) 5 files
other665 LOC (6%) 25 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
policy
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 83 files match defined criteria (8,652 lines of code, 100.0% vs. main code):
    • 17 *.tsx files (3,147 lines of code)
    • 23 *.ts files (2,818 lines of code)
    • 35 *.kt files (2,399 lines of code)
    • 1 *.java files (172 lines of code)
    • 4 *.yml files (47 lines of code)
    • 1 *.js files (39 lines of code)
    • 1 *.scss files (19 lines of code)
    • 1 *.policy files (11 lines of code)
  • " *.tsx" is biggest, containing 36.37% of code.
  • " *.policy" is smallest, containing 0.13% of code.


*.tsx3147 LOC (36%) 17 files
*.ts2818 LOC (32%) 23 files
*.kt2399 LOC (27%) 35 files
*.java172 LOC (1%) 1 files
*.yml47 LOC (<1%) 4 files
*.js39 LOC (<1%) 1 files
*.scss19 LOC (<1%) 1 files
*.policy11 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 ".*[.]spec[.]js".
    • files with paths like ".*__test__.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 10 files match defined criteria (1,143 lines of code, 13.2% vs. main code):
    • 4 *.tsx files (671 lines of code)
    • 5 *.kt files (463 lines of code)
    • 1 *.js files (9 lines of code)
  • " *.tsx" is biggest, containing 58.71% of code.
  • " *.js" is smallest, containing 0.79% of code.


*.tsx671 LOC (58%) 4 files
*.kt463 LOC (40%) 5 files
*.js9 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 ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/pom[.]xml".
  • 5 files match defined criteria (376 lines of code, 4.3% vs. main code):
    • 4 *.gradle files (291 lines of code)
    • 1 *.bat files (85 lines of code)
  • " *.gradle" is biggest, containing 77.39% of code.
  • " *.bat" is smallest, containing 22.61% of code.


*.gradle291 LOC (77%) 4 files
*.bat85 LOC (22%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/config/checkstyle/.*".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/README[.][a-z0-9]+".
    • 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)".
  • 25 files match defined criteria (665 lines of code, 7.7% vs. main code):
    • 4 *.xml files (356 lines of code)
    • 17 *.md files (224 lines of code)
    • 4 *.json files (85 lines of code)
  • " *.xml" is biggest, containing 53.53% of code.
  • " *.json" is smallest, containing 12.78% of code.


*.xml356 LOC (53%) 4 files
*.md224 LOC (33%) 17 files
*.json85 LOC (12%) 4 files
Analyzers
Info about analyzers used for source code examinations.
  • *.tsx files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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)
  • *.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
  • *.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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.policy 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-02-01 05:03