kubernetes / examples
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
  • 17 extensions are included in analyses: yaml, md, sh, json, go, gitignore, html, py, java, xml, js, yml, css, h, sql, txt, php
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 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 ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (0 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.

main5855 LOC (38%) 244 files
test643 LOC (4%) 8 files
generated0 LOC (0%) 0 files
build and deployment1038 LOC (6%) 34 files
other7692 LOC (50%) 92 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 ".*".
  • 244 files match defined criteria (5,855 lines of code, 100.0% vs. main code):
    • 223 *.yaml files (5,107 lines of code)
    • 6 *.go files (298 lines of code)
    • 4 *.html files (81 lines of code)
    • 2 *.java files (77 lines of code)
    • 2 *.js files (61 lines of code)
    • 2 *.yml files (61 lines of code)
    • 1 *.css files (53 lines of code)
    • 1 *.h files (42 lines of code)
    • 2 *.py files (40 lines of code)
    • 1 *.php files (35 lines of code)
  • " *.yaml" is biggest, containing 87.22% of code.
  • " *.php" is smallest, containing 0.6% of code.


*.yaml5107 LOC (87%) 223 files
*.go298 LOC (5%) 6 files
*.html81 LOC (1%) 4 files
*.java77 LOC (1%) 2 files
*.js61 LOC (1%) 2 files
*.yml61 LOC (1%) 2 files
*.css53 LOC (<1%) 1 files
*.h42 LOC (<1%) 1 files
*.py40 LOC (<1%) 2 files
*.php35 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]est/.*".
    • files with paths like ".*_test[.].*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*(/|[-])selenium/.*".
  • 8 files match defined criteria (643 lines of code, 11.0% vs. main code):
    • 1 *.go files (425 lines of code)
    • 5 *.yaml files (177 lines of code)
    • 1 *.java files (25 lines of code)
    • 1 *.py files (16 lines of code)
  • " *.go" is biggest, containing 66.1% of code.
  • " *.py" is smallest, containing 2.49% of code.


*.go425 LOC (66%) 1 files
*.yaml177 LOC (27%) 5 files
*.java25 LOC (3%) 1 files
*.py16 LOC (2%) 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 ".*/pom[.]xml".
  • 34 files match defined criteria (1,038 lines of code, 17.7% vs. main code). All matches are in *.sh files.


*.sh1038 LOC (100%) 34 files
Other Code
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 ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 92 files match defined criteria (7,692 lines of code, 131.4% vs. main code):
    • 68 *.md files (6,977 lines of code)
    • 20 *.json files (609 lines of code)
    • 3 *.xml files (99 lines of code)
    • 1 *.sql files (7 lines of code)
  • " *.md" is biggest, containing 90.7% of code.
  • " *.sql" is smallest, containing 0.09% of code.


*.md6977 LOC (90%) 68 files
*.json609 LOC (7%) 20 files
*.xml99 LOC (1%) 3 files
*.sql7 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
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.h files are analyzed with CppAnalyzer:
    • 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
  • *.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
  • *.php files are analyzed with PhpAnalyzer:
    • 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


2022-02-03 09:16