opensearch-project / OpenSearch-Dashboards
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
ejs
txt
npmignore
asciidoc
babelrc
gitattributes
dockerignore
patch
handlebars
editorconfig
hbs
eslintignore
  • 29 extensions are included in analyses: ts, js, tsx, json, scss, snap, md, svg, html, sh, yml, ejs, txt, css, xml, gitignore, npmignore, jsx, bat, asciidoc, babelrc, json5, gitattributes, dockerignore, patch, handlebars, editorconfig, hbs, eslintignore
  • 12 criteria are used to exclude files from analysis:
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (52 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (32 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (36 files).
    • exclude files with path like ".*/angular([^.]*)\.js" (AngularJS) (27 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (6 files).
    • exclude files with path like ".*/react(-[^.]*)?\.js" (React) (2 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 "(?i).*/jquery.*[.]js" (jQuery files) (15 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (2 files).
    • exclude files with path like ".*[.]txt" (Text files) (14 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.

main297314 LOC (46%) 5344 files
test268375 LOC (41%) 2515 files
generated7760 LOC (1%) 132 files
build and deployment1320 LOC (<1%) 23 files
other65500 LOC (10%) 859 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ejs
handlebars
hbs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 5344 files match defined criteria (297,314 lines of code, 100.0% vs. main code):
    • 3,174 *.ts files (141,370 lines of code)
    • 1,109 *.js files (78,983 lines of code)
    • 614 *.tsx files (56,907 lines of code)
    • 3 *.css files (8,776 lines of code)
    • 341 *.scss files (6,778 lines of code)
    • 71 *.html files (2,449 lines of code)
    • 1 *.json5 files (1,123 lines of code)
    • 16 *.ejs files (434 lines of code)
    • 1 *.handlebars files (225 lines of code)
    • 13 *.yml files (190 lines of code)
    • 1 *.hbs files (79 lines of code)
  • " *.ts" is biggest, containing 47.55% of code.
  • " *.hbs" is smallest, containing 0.03% of code.


*.ts141370 LOC (47%) 3174 files
*.js78983 LOC (26%) 1109 files
*.tsx56907 LOC (19%) 614 files
*.css8776 LOC (2%) 3 files
*.scss6778 LOC (2%) 341 files
*.html2449 LOC (<1%) 71 files
*.json51123 LOC (<1%) 1 files
*.ejs434 LOC (<1%) 16 files
*.handlebars225 LOC (<1%) 1 files
*.yml190 LOC (<1%) 13 files
*.hbs79 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 ".*/[Tt]ests/.*".
    • 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 ".*/__mocks?__/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 2515 files match defined criteria (268,375 lines of code, 90.3% vs. main code):
    • 1,330 *.ts files (131,858 lines of code)
    • 311 *.snap files (61,196 lines of code)
    • 555 *.js files (50,748 lines of code)
    • 290 *.tsx files (24,431 lines of code)
    • 3 *.yml files (55 lines of code)
    • 20 *.sh files (39 lines of code)
    • 3 *.jsx files (34 lines of code)
    • 2 *.html files (9 lines of code)
    • 1 *.scss files (5 lines of code)
  • " *.ts" is biggest, containing 49.13% of code.
  • " *.scss" is smallest, containing 0% of code.


*.ts131858 LOC (49%) 1330 files
*.snap61196 LOC (22%) 311 files
*.js50748 LOC (18%) 555 files
*.tsx24431 LOC (9%) 290 files
*.yml55 LOC (<1%) 3 files
*.sh39 LOC (<1%) 20 files
*.jsx34 LOC (<1%) 3 files
*.html9 LOC (<1%) 2 files
*.scss5 LOC (<1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/generated/.*".
    • files with paths like ".*/_generated_/.*".
  • 132 files match defined criteria (7,760 lines of code, 2.6% vs. main code):
    • 2 *.js files (4,601 lines of code)
    • 130 *.json files (3,159 lines of code)
  • " *.js" is biggest, containing 59.29% of code.
  • " *.json" is smallest, containing 40.71% of code.


*.js4601 LOC (59%) 2 files
*.json3159 LOC (40%) 130 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 ".*/package[.]json".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 23 files match defined criteria (1,320 lines of code, 0.4% vs. main code):
    • 16 *.sh files (771 lines of code)
    • 2 *.ts files (273 lines of code)
    • 4 *.js files (268 lines of code)
    • 1 *.yml files (8 lines of code)
  • " *.sh" is biggest, containing 58.41% of code.
  • " *.yml" is smallest, containing 0.61% of code.


*.sh771 LOC (58%) 16 files
*.ts273 LOC (20%) 2 files
*.js268 LOC (20%) 4 files
*.yml8 LOC (<1%) 1 files
Other Code
snap
patch
asciidoc
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 859 files match defined criteria (65,500 lines of code, 22.0% vs. main code):
    • 504 *.json files (38,834 lines of code)
    • 141 *.md files (16,823 lines of code)
    • 74 *.tsx files (4,990 lines of code)
    • 38 *.svg files (2,445 lines of code)
    • 85 *.ts files (1,900 lines of code)
    • 5 *.js files (289 lines of code)
    • 5 *.xml files (110 lines of code)
    • 1 *.snap files (60 lines of code)
    • 1 *.patch files (31 lines of code)
    • 2 *.asciidoc files (11 lines of code)
    • 2 *.scss files (6 lines of code)
    • 1 *.html files (1 lines of code)
  • " *.json" is biggest, containing 59.29% of code.
  • " *.html" is smallest, containing 0% of code.


*.json38834 LOC (59%) 504 files
*.md16823 LOC (25%) 141 files
*.tsx4990 LOC (7%) 74 files
*.svg2445 LOC (3%) 38 files
*.ts1900 LOC (2%) 85 files
*.js289 LOC (<1%) 5 files
*.xml110 LOC (<1%) 5 files
*.snap60 LOC (<1%) 1 files
*.patch31 LOC (<1%) 1 files
*.asciidoc11 LOC (<1%) 2 files
*.scss6 LOC (<1%) 2 files
*.html1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.json5 files are analyzed with JsonAnalyzer:
    • 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
  • *.ejs 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
  • *.handlebars 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
  • *.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
  • *.hbs 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


2022-02-01 04:58