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

main30989 LOC (27%) 310 files
test79620 LOC (71%) 179 files
generated0 LOC (0%) 0 files
build and deployment511 LOC (<1%) 4 files
other846 LOC (<1%) 27 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 ".*".
  • 310 files match defined criteria (30,989 lines of code, 100.0% vs. main code):
    • 118 *.tsx files (15,105 lines of code)
    • 123 *.ts files (10,872 lines of code)
    • 41 *.kt files (3,759 lines of code)
    • 23 *.scss files (1,156 lines of code)
    • 4 *.yml files (86 lines of code)
    • 1 *.policy files (11 lines of code)
  • " *.tsx" is biggest, containing 48.74% of code.
  • " *.policy" is smallest, containing 0.04% of code.


*.tsx15105 LOC (48%) 118 files
*.ts10872 LOC (35%) 123 files
*.kt3759 LOC (12%) 41 files
*.scss1156 LOC (3%) 23 files
*.yml86 LOC (<1%) 4 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 ".*[.]spec[.]js".
    • files with paths like ".*/[Tt]est/.*".
    • 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 paths like ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 179 files match defined criteria (79,620 lines of code, 256.9% vs. main code):
    • 68 *.snap files (72,731 lines of code)
    • 76 *.tsx files (3,702 lines of code)
    • 24 *.kt files (2,122 lines of code)
    • 8 *.ts files (1,039 lines of code)
    • 3 *.js files (26 lines of code)
  • " *.snap" is biggest, containing 91.35% of code.
  • " *.js" is smallest, containing 0.03% of code.


*.snap72731 LOC (91%) 68 files
*.tsx3702 LOC (4%) 76 files
*.kt2122 LOC (2%) 24 files
*.ts1039 LOC (1%) 8 files
*.js26 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 ".*/package[.]json".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]gradle".
  • 4 files match defined criteria (511 lines of code, 1.6% vs. main code):
    • 3 *.gradle files (425 lines of code)
    • 1 *.bat files (86 lines of code)
  • " *.gradle" is biggest, containing 83.17% of code.
  • " *.bat" is smallest, containing 16.83% of code.


*.gradle425 LOC (83%) 3 files
*.bat86 LOC (16%) 1 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • 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 ".*[.]editorconfig".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 27 files match defined criteria (846 lines of code, 2.7% vs. main code):
    • 19 *.md files (406 lines of code)
    • 3 *.xml files (315 lines of code)
    • 5 *.json files (125 lines of code)
  • " *.md" is biggest, containing 47.99% of code.
  • " *.json" is smallest, containing 14.78% of code.


*.md406 LOC (47%) 19 files
*.xml315 LOC (37%) 3 files
*.json125 LOC (14%) 5 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)
  • *.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
  • *.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
  • *.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:00