GerritCodeReview / gerrit-ci-scripts
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
ini
xslt
  • 10 extensions are included in analyses: yaml, sh, groovy, xml, json, txt, md, ini, gitignore, xslt
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (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 ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (2 files).
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.

main2852 LOC (63%) 124 files
test242 LOC (5%) 3 files
generated0 LOC (0%) 0 files
build and deployment739 LOC (16%) 36 files
other644 LOC (14%) 13 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xslt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 124 files match defined criteria (2,852 lines of code, 100.0% vs. main code):
    • 119 *.yaml files (2,434 lines of code)
    • 4 *.groovy files (386 lines of code)
    • 1 *.xslt files (32 lines of code)
  • " *.yaml" is biggest, containing 85.34% of code.
  • " *.xslt" is smallest, containing 1.12% of code.


*.yaml2434 LOC (85%) 119 files
*.groovy386 LOC (13%) 4 files
*.xslt32 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 ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 3 files match defined criteria (242 lines of code, 8.5% vs. main code):
    • 1 *.groovy files (215 lines of code)
    • 1 *.sh files (15 lines of code)
    • 1 *.yaml files (12 lines of code)
  • " *.groovy" is biggest, containing 88.84% of code.
  • " *.yaml" is smallest, containing 4.96% of code.


*.groovy215 LOC (88%) 1 files
*.sh15 LOC (6%) 1 files
*.yaml12 LOC (4%) 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/jenkins/.*[.]groovy".
  • 36 files match defined criteria (739 lines of code, 25.9% vs. main code):
    • 35 *.sh files (734 lines of code)
    • 1 *.groovy files (5 lines of code)
  • " *.sh" is biggest, containing 99.32% of code.
  • " *.groovy" is smallest, containing 0.68% of code.


*.sh734 LOC (99%) 35 files
*.groovy5 LOC (<1%) 1 files
Other Code
ini
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 ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 13 files match defined criteria (644 lines of code, 22.6% vs. main code):
    • 6 *.xml files (511 lines of code)
    • 3 *.md files (106 lines of code)
    • 3 *.json files (19 lines of code)
    • 1 *.ini files (8 lines of code)
  • " *.xml" is biggest, containing 79.35% of code.
  • " *.ini" is smallest, containing 1.24% of code.


*.xml511 LOC (79%) 6 files
*.md106 LOC (16%) 3 files
*.json19 LOC (2%) 3 files
*.ini8 LOC (1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.yaml 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
  • *.xslt files are analyzed with XmlAnalyzer:
    • 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


2022-02-03 05:45