bazelbuild / rules_docker
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
tpl
txt
pub
  • 22 extensions are included in analyses: yaml, bzl, go, sh, py, tpl, md, json, java, txt, yml, gitignore, scala, cc, kt, groovy, rs, js, d, h, pub, ts
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/testdata/.*" (Test data) (44 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (9 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) (4 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.

main12063 LOC (66%) 119 files
test3910 LOC (21%) 117 files
generated0 LOC (0%) 0 files
build and deployment347 LOC (1%) 4 files
other1765 LOC (9%) 26 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 119 files match defined criteria (12,063 lines of code, 100.0% vs. main code):
    • 65 *.bzl files (8,002 lines of code)
    • 23 *.go files (2,193 lines of code)
    • 7 *.py files (1,014 lines of code)
    • 16 *.tpl files (677 lines of code)
    • 5 *.yaml files (132 lines of code)
    • 2 *.java files (33 lines of code)
    • 1 *.yml files (12 lines of code)
  • " *.bzl" is biggest, containing 66.34% of code.
  • " *.yml" is smallest, containing 0.1% of code.


*.bzl8002 LOC (66%) 65 files
*.go2193 LOC (18%) 23 files
*.py1014 LOC (8%) 7 files
*.tpl677 LOC (5%) 16 files
*.yaml132 LOC (1%) 5 files
*.java33 LOC (<1%) 2 files
*.yml12 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
tpl
pub
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 117 files match defined criteria (3,910 lines of code, 32.4% vs. main code):
    • 76 *.yaml files (1,192 lines of code)
    • 4 *.py files (994 lines of code)
    • 7 *.bzl files (685 lines of code)
    • 24 *.sh files (511 lines of code)
    • 4 *.go files (451 lines of code)
    • 1 *.tpl files (64 lines of code)
    • 1 *.pub files (13 lines of code)
  • " *.yaml" is biggest, containing 30.49% of code.
  • " *.pub" is smallest, containing 0.33% of code.


*.yaml1192 LOC (30%) 76 files
*.py994 LOC (25%) 4 files
*.bzl685 LOC (17%) 7 files
*.sh511 LOC (13%) 24 files
*.go451 LOC (11%) 4 files
*.tpl64 LOC (1%) 1 files
*.pub13 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/package[.]json".
  • 4 files match defined criteria (347 lines of code, 2.9% vs. main code). All matches are in *.sh files.


*.sh347 LOC (100%) 4 files
Other Code
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 ".*/[.]gitignore".
  • 26 files match defined criteria (1,765 lines of code, 14.6% vs. main code):
    • 8 *.md files (1,517 lines of code)
    • 11 *.yaml files (148 lines of code)
    • 5 *.json files (90 lines of code)
    • 2 *.java files (10 lines of code)
  • " *.md" is biggest, containing 85.95% of code.
  • " *.java" is smallest, containing 0.57% of code.


*.md1517 LOC (85%) 8 files
*.yaml148 LOC (8%) 11 files
*.json90 LOC (5%) 5 files
*.java10 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.bzl 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
  • *.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
  • *.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
  • *.tpl 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
  • *.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
  • *.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)
  • *.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


2022-02-03 05:30