bazelbuild / continuous-integration
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
hcl
tpl
txt
properties
mod
dockerignore
cfg
cmd
  • 28 extensions are included in analyses: java, go, yml, py, sh, md, xml, tsx, json, rs, ts, gitignore, js, hcl, toml, tpl, tf, ps1, txt, properties, css, mod, dockerignore, sql, bzl, yaml, cfg, cmd
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (26 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (6 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • exclude files with path like ".*/mvnw\.cmd" (Maven) (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) (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.

main19545 LOC (89%) 201 files
test344 LOC (1%) 6 files
generated0 LOC (0%) 0 files
build and deployment641 LOC (2%) 23 files
other1193 LOC (5%) 25 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
tpl
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 201 files match defined criteria (19,545 lines of code, 100.0% vs. main code):
    • 23 *.py files (5,873 lines of code)
    • 77 *.java files (3,836 lines of code)
    • 39 *.go files (3,276 lines of code)
    • 3 *.tf files (2,095 lines of code)
    • 11 *.tsx files (1,690 lines of code)
    • 21 *.yml files (1,304 lines of code)
    • 5 *.rs files (548 lines of code)
    • 2 *.ps1 files (420 lines of code)
    • 6 *.ts files (231 lines of code)
    • 3 *.tpl files (109 lines of code)
    • 1 *.bzl files (60 lines of code)
    • 4 *.js files (52 lines of code)
    • 3 *.toml files (26 lines of code)
    • 1 *.css files (13 lines of code)
    • 1 *.yaml files (10 lines of code)
    • 1 *.cfg files (2 lines of code)
  • " *.py" is biggest, containing 30.05% of code.
  • " *.cfg" is smallest, containing 0.01% of code.


*.py5873 LOC (30%) 23 files
*.java3836 LOC (19%) 77 files
*.go3276 LOC (16%) 39 files
*.tf2095 LOC (10%) 3 files
*.tsx1690 LOC (8%) 11 files
*.yml1304 LOC (6%) 21 files
*.rs548 LOC (2%) 5 files
*.ps1420 LOC (2%) 2 files
*.ts231 LOC (1%) 6 files
*.tpl109 LOC (<1%) 3 files
*.bzl60 LOC (<1%) 1 files
*.js52 LOC (<1%) 4 files
*.toml26 LOC (<1%) 3 files
*.css13 LOC (<1%) 1 files
*.yaml10 LOC (<1%) 1 files
*.cfg2 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 ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 6 files match defined criteria (344 lines of code, 1.8% vs. main code):
    • 1 *.go files (153 lines of code)
    • 3 *.rs files (126 lines of code)
    • 1 *.py files (56 lines of code)
    • 1 *.java files (9 lines of code)
  • " *.go" is biggest, containing 44.48% of code.
  • " *.java" is smallest, containing 2.62% of code.


*.go153 LOC (44%) 1 files
*.rs126 LOC (36%) 3 files
*.py56 LOC (16%) 1 files
*.java9 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*/[.]mvn/.*".
  • 23 files match defined criteria (641 lines of code, 3.3% vs. main code). All matches are in *.sh files.


*.sh641 LOC (100%) 23 files
Other Code
mod
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 25 files match defined criteria (1,193 lines of code, 6.1% vs. main code):
    • 13 *.md files (711 lines of code)
    • 1 *.sql files (236 lines of code)
    • 8 *.json files (115 lines of code)
    • 1 *.xml files (103 lines of code)
    • 1 *.mod files (24 lines of code)
    • 1 *.properties files (4 lines of code)
  • " *.md" is biggest, containing 59.6% of code.
  • " *.properties" is smallest, containing 0.34% of code.


*.md711 LOC (59%) 13 files
*.sql236 LOC (19%) 1 files
*.json115 LOC (9%) 8 files
*.xml103 LOC (8%) 1 files
*.mod24 LOC (2%) 1 files
*.properties4 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
  • *.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)
  • *.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
  • *.tf 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
  • *.tsx 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
  • *.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
  • *.rs files are analyzed with RustAnalyzer:
    • 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
  • *.ps1 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-02-03 05:28