opensearch-project / opensearch-build
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
properties
npmignore
ini
meta
  • 19 extensions are included in analyses: py, yml, sh, groovy, md, txt, json, dockerfile, ts, properties, yaml, gitignore, js, gradle, npmignore, bat, ini, toml, meta
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/dist/.*" (Distributions) (2 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (22 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 ".*/bin/.*" (Binaries for distribution) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (35 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.

main5560 LOC (9%) 169 files
test46867 LOC (78%) 246 files
generated0 LOC (0%) 0 files
build and deployment4062 LOC (6%) 65 files
other2862 LOC (4%) 41 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 169 files match defined criteria (5,560 lines of code, 100.0% vs. main code):
    • 101 *.py files (3,055 lines of code)
    • 38 *.yml files (1,908 lines of code)
    • 24 *.groovy files (416 lines of code)
    • 4 *.ts files (159 lines of code)
    • 1 *.toml files (14 lines of code)
    • 1 *.js files (8 lines of code)
  • " *.py" is biggest, containing 54.95% of code.
  • " *.js" is smallest, containing 0.14% of code.


*.py3055 LOC (54%) 101 files
*.yml1908 LOC (34%) 38 files
*.groovy416 LOC (7%) 24 files
*.ts159 LOC (2%) 4 files
*.toml14 LOC (<1%) 1 files
*.js8 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]ests/.*".
    • files with paths like ".*/tests_.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 246 files match defined criteria (46,867 lines of code, 842.9% vs. main code):
    • 41 *.yml files (38,937 lines of code)
    • 161 *.py files (6,982 lines of code)
    • 33 *.groovy files (913 lines of code)
    • 1 *.ts files (25 lines of code)
    • 10 *.sh files (10 lines of code)
  • " *.yml" is biggest, containing 83.08% of code.
  • " *.sh" is smallest, containing 0.02% of code.


*.yml38937 LOC (83%) 41 files
*.py6982 LOC (14%) 161 files
*.groovy913 LOC (1%) 33 files
*.ts25 LOC (<1%) 1 files
*.sh10 LOC (<1%) 10 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 ".*/jenkins/.*[.]groovy".
    • 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 ".*[.]dockerfile".
    • files with paths like ".*/docker[-]compose[.]yml".
  • 65 files match defined criteria (4,062 lines of code, 73.1% vs. main code):
    • 52 *.sh files (3,033 lines of code)
    • 6 *.dockerfile files (629 lines of code)
    • 3 *.groovy files (177 lines of code)
    • 2 *.gradle files (91 lines of code)
    • 1 *.bat files (68 lines of code)
    • 1 *.yml files (64 lines of code)
  • " *.sh" is biggest, containing 74.67% of code.
  • " *.yml" is smallest, containing 1.58% of code.


*.sh3033 LOC (74%) 52 files
*.dockerfile629 LOC (15%) 6 files
*.groovy177 LOC (4%) 3 files
*.gradle91 LOC (2%) 2 files
*.bat68 LOC (1%) 1 files
*.yml64 LOC (1%) 1 files
Other Code
properties
ini
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 ".*[.]txt".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
  • 41 files match defined criteria (2,862 lines of code, 51.5% vs. main code):
    • 33 *.md files (2,689 lines of code)
    • 4 *.json files (119 lines of code)
    • 3 *.properties files (51 lines of code)
    • 1 *.ini files (3 lines of code)
  • " *.md" is biggest, containing 93.96% of code.
  • " *.ini" is smallest, containing 0.1% of code.


*.md2689 LOC (93%) 33 files
*.json119 LOC (4%) 4 files
*.properties51 LOC (1%) 3 files
*.ini3 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.groovy files are analyzed with GroovyAnalyzer:
    • 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
  • *.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
  • *.toml 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
  • *.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


2022-02-01 05:04