opensearch-project / OpenSearch
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
policy
prefs
g4
cfg
editorconfig
el
gitattributes
sig
asciidoc
st
  • 26 extensions are included in analyses: java, yml, txt, json, gradle, properties, groovy, md, policy, bat, sh, xml, html, gitignore, ftl, prefs, g4, cfg, py, editorconfig, el, gitattributes, sig, asciidoc, st, bash
  • 10 criteria are used to exclude files from analysis:
    • 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 ".*/bin/.*" (Binaries for distribution) (11 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 ".*/cache/.*" (Caches) (25 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (3 files).
    • exclude files with path like ".*/dependencies/.*" (Dependencies) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (363 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.

main673297 LOC (53%) 5037 files
test541897 LOC (43%) 3262 files
generated0 LOC (0%) 0 files
build and deployment7552 LOC (<1%) 173 files
other35258 LOC (2%) 407 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
policy
g4
sig
cfg
prefs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 5037 files match defined criteria (673,297 lines of code, 100.0% vs. main code):
    • 4,973 *.java files (669,042 lines of code)
    • 27 *.groovy files (2,631 lines of code)
    • 23 *.policy files (1,092 lines of code)
    • 2 *.g4 files (317 lines of code)
    • 1 *.py files (73 lines of code)
    • 1 *.sig files (50 lines of code)
    • 2 *.cfg files (42 lines of code)
    • 2 *.prefs files (27 lines of code)
    • 3 *.yml files (16 lines of code)
    • 3 *.ftl files (7 lines of code)
  • " *.java" is biggest, containing 99.37% of code.
  • " *.ftl" is smallest, containing 0% of code.


*.java669042 LOC (99%) 4973 files
*.groovy2631 LOC (<1%) 27 files
*.policy1092 LOC (<1%) 23 files
*.g4317 LOC (<1%) 2 files
*.py73 LOC (<1%) 1 files
*.sig50 LOC (<1%) 1 files
*.cfg42 LOC (<1%) 2 files
*.prefs27 LOC (<1%) 2 files
*.yml16 LOC (<1%) 3 files
*.ftl7 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
policy
asciidoc
st
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 ".*_test[.].*".
    • files with paths like ".*[-]tests/.*".
    • files with paths like ".*/tests_.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 3262 files match defined criteria (541,897 lines of code, 80.5% vs. main code):
    • 2,546 *.java files (476,989 lines of code)
    • 667 *.yml files (62,717 lines of code)
    • 8 *.groovy files (1,438 lines of code)
    • 22 *.gradle files (378 lines of code)
    • 6 *.policy files (142 lines of code)
    • 6 *.sh files (111 lines of code)
    • 1 *.bash files (72 lines of code)
    • 4 *.html files (45 lines of code)
    • 1 *.asciidoc files (3 lines of code)
    • 1 *.st files (2 lines of code)
  • " *.java" is biggest, containing 88.02% of code.
  • " *.st" is smallest, containing 0% of code.


*.java476989 LOC (88%) 2546 files
*.yml62717 LOC (11%) 667 files
*.groovy1438 LOC (<1%) 8 files
*.gradle378 LOC (<1%) 22 files
*.policy142 LOC (<1%) 6 files
*.sh111 LOC (<1%) 6 files
*.bash72 LOC (<1%) 1 files
*.html45 LOC (<1%) 4 files
*.asciidoc3 LOC (<1%) 1 files
*.st2 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 ".*[.]sh".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
  • 173 files match defined criteria (7,552 lines of code, 1.1% vs. main code):
    • 167 *.gradle files (7,272 lines of code)
    • 3 *.yml files (156 lines of code)
    • 1 *.bat files (68 lines of code)
    • 2 *.sh files (56 lines of code)
  • " *.gradle" is biggest, containing 96.29% of code.
  • " *.sh" is smallest, containing 0.74% of code.


*.gradle7272 LOC (96%) 167 files
*.yml156 LOC (2%) 3 files
*.bat68 LOC (<1%) 1 files
*.sh56 LOC (<1%) 2 files
Other Code
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 407 files match defined criteria (35,258 lines of code, 5.2% vs. main code):
    • 247 *.json files (21,845 lines of code)
    • 47 *.java files (8,060 lines of code)
    • 26 *.md files (2,659 lines of code)
    • 59 *.properties files (1,724 lines of code)
    • 17 *.yml files (477 lines of code)
    • 3 *.xml files (379 lines of code)
    • 8 *.gradle files (114 lines of code)
  • " *.json" is biggest, containing 61.96% of code.
  • " *.gradle" is smallest, containing 0.32% of code.


*.json21845 LOC (61%) 247 files
*.java8060 LOC (22%) 47 files
*.md2659 LOC (7%) 26 files
*.properties1724 LOC (4%) 59 files
*.yml477 LOC (1%) 17 files
*.xml379 LOC (1%) 3 files
*.gradle114 LOC (<1%) 8 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.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
  • *.g4 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
  • *.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
  • *.sig 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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.prefs 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
  • *.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
  • *.ftl 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 04:48