bazelbuild / rules_go
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
proto
txt
patch
s
in
tpl
  • 22 extensions are included in analyses: go, bzl, rst, c, proto, txt, patch, s, md, sh, h, json, in, cc, m, py, xml, yml, mm, cpp, gitignore, tpl
  • 11 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (13 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (2 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (2 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (5 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (1 file).
    • exclude files with path like ".*/docs/.*" (Documentation) (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 ".*[.]txt" (Text files) (13 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.

main16428 LOC (59%) 109 files
test6493 LOC (23%) 307 files
generated0 LOC (0%) 0 files
build and deployment13 LOC (<1%) 3 files
other4754 LOC (17%) 98 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 109 files match defined criteria (16,428 lines of code, 100.0% vs. main code):
    • 59 *.go files (9,163 lines of code)
    • 47 *.bzl files (7,237 lines of code)
    • 3 *.in files (28 lines of code)
  • " *.go" is biggest, containing 55.78% of code.
  • " *.in" is smallest, containing 0.17% of code.


*.go9163 LOC (55%) 59 files
*.bzl7237 LOC (44%) 47 files
*.in28 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
proto
s
in
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 ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 307 files match defined criteria (6,493 lines of code, 39.5% vs. main code):
    • 223 *.go files (5,122 lines of code)
    • 14 *.bzl files (636 lines of code)
    • 2 *.py files (313 lines of code)
    • 16 *.proto files (135 lines of code)
    • 25 *.c files (97 lines of code)
    • 5 *.sh files (66 lines of code)
    • 3 *.m files (36 lines of code)
    • 8 *.s files (33 lines of code)
    • 1 *.cpp files (16 lines of code)
    • 6 *.h files (16 lines of code)
    • 2 *.cc files (11 lines of code)
    • 1 *.mm files (9 lines of code)
    • 1 *.in files (3 lines of code)
  • " *.go" is biggest, containing 78.88% of code.
  • " *.in" is smallest, containing 0.05% of code.


*.go5122 LOC (78%) 223 files
*.bzl636 LOC (9%) 14 files
*.py313 LOC (4%) 2 files
*.proto135 LOC (2%) 16 files
*.c97 LOC (1%) 25 files
*.sh66 LOC (1%) 5 files
*.m36 LOC (<1%) 3 files
*.s33 LOC (<1%) 8 files
*.cpp16 LOC (<1%) 1 files
*.h16 LOC (<1%) 6 files
*.cc11 LOC (<1%) 2 files
*.mm9 LOC (<1%) 1 files
*.in3 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".
  • 3 files match defined criteria (13 lines of code, 0.1% vs. main code). All matches are in *.sh files.


*.sh13 LOC (100%) 3 files
Other Code
proto
s
tpl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 98 files match defined criteria (4,754 lines of code, 28.9% vs. main code):
    • 51 *.rst files (4,144 lines of code)
    • 25 *.go files (361 lines of code)
    • 7 *.proto files (63 lines of code)
    • 4 *.s files (52 lines of code)
    • 2 *.md files (46 lines of code)
    • 1 *.cc files (19 lines of code)
    • 2 *.c files (19 lines of code)
    • 3 *.h files (17 lines of code)
    • 1 *.bzl files (16 lines of code)
    • 1 *.tpl files (11 lines of code)
    • 1 *.sh files (6 lines of code)
  • " *.rst" is biggest, containing 87.17% of code.
  • " *.sh" is smallest, containing 0.13% of code.


*.rst4144 LOC (87%) 51 files
*.go361 LOC (7%) 25 files
*.proto63 LOC (1%) 7 files
*.s52 LOC (1%) 4 files
*.md46 LOC (<1%) 2 files
*.cc19 LOC (<1%) 1 files
*.c19 LOC (<1%) 2 files
*.h17 LOC (<1%) 3 files
*.bzl16 LOC (<1%) 1 files
*.tpl11 LOC (<1%) 1 files
*.sh6 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.in 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


2022-02-03 05:29