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

main14788 LOC (46%) 152 files
test14678 LOC (46%) 64 files
generated0 LOC (0%) 0 files
build and deployment675 LOC (2%) 6 files
other1391 LOC (4%) 26 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 ".*".
  • 152 files match defined criteria (14,788 lines of code, 100.0% vs. main code):
    • 22 *.tsx files (5,648 lines of code)
    • 62 *.kt files (4,068 lines of code)
    • 45 *.ts files (3,307 lines of code)
    • 5 *.js files (815 lines of code)
    • 3 *.html files (429 lines of code)
    • 4 *.java files (202 lines of code)
    • 1 *.css files (192 lines of code)
    • 6 *.yml files (58 lines of code)
    • 1 *.py files (31 lines of code)
    • 2 *.scss files (27 lines of code)
    • 1 *.policy files (11 lines of code)
  • " *.tsx" is biggest, containing 38.19% of code.
  • " *.policy" is smallest, containing 0.07% of code.


*.tsx5648 LOC (38%) 22 files
*.kt4068 LOC (27%) 62 files
*.ts3307 LOC (22%) 45 files
*.js815 LOC (5%) 5 files
*.html429 LOC (2%) 3 files
*.java202 LOC (1%) 4 files
*.css192 LOC (1%) 1 files
*.yml58 LOC (<1%) 6 files
*.py31 LOC (<1%) 1 files
*.scss27 LOC (<1%) 2 files
*.policy11 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 ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.]spec[.]ts".
    • files with paths like ".*/__mocks?__/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[.]snap".
    • files with any line of content like ".*/simpletest/.*".
  • 64 files match defined criteria (14,678 lines of code, 99.3% vs. main code):
    • 7 *.snap files (8,181 lines of code)
    • 31 *.kt files (3,520 lines of code)
    • 11 *.tsx files (2,394 lines of code)
    • 8 *.ts files (450 lines of code)
    • 2 *.java files (75 lines of code)
    • 5 *.js files (58 lines of code)
  • " *.snap" is biggest, containing 55.74% of code.
  • " *.js" is smallest, containing 0.4% of code.


*.snap8181 LOC (55%) 7 files
*.kt3520 LOC (23%) 31 files
*.tsx2394 LOC (16%) 11 files
*.ts450 LOC (3%) 8 files
*.java75 LOC (<1%) 2 files
*.js58 LOC (<1%) 5 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 ".*[.]sh".
  • 6 files match defined criteria (675 lines of code, 4.6% vs. main code):
    • 4 *.gradle files (481 lines of code)
    • 1 *.sh files (118 lines of code)
    • 1 *.bat files (76 lines of code)
  • " *.gradle" is biggest, containing 71.26% of code.
  • " *.bat" is smallest, containing 11.26% of code.


*.gradle481 LOC (71%) 4 files
*.sh118 LOC (17%) 1 files
*.bat76 LOC (11%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • 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 ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 26 files match defined criteria (1,391 lines of code, 9.4% vs. main code):
    • 17 *.md files (557 lines of code)
    • 6 *.json files (519 lines of code)
    • 3 *.xml files (315 lines of code)
  • " *.md" is biggest, containing 40.04% of code.
  • " *.xml" is smallest, containing 22.65% of code.


*.md557 LOC (40%) 17 files
*.json519 LOC (37%) 6 files
*.xml315 LOC (22%) 3 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
  • *.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)
  • *.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
  • *.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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.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)
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.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
  • *.py files are analyzed with PythonAnalyzer:
    • 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
  • *.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:04