golang / pkgsite
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
mod
snap
dockerignore
stylelintignore
eslintignore
prettierignore
  • 21 extensions are included in analyses: go, sql, css, txt, svg, md, ts, sh, js, yaml, mod, json, py, gitignore, snap, dockerignore, stylelintignore, yml, bash, eslintignore, prettierignore
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (17 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (0 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (145 files).
    • exclude files with path like ".*/cache/.*" (Caches) (2 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) (8 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.

main44765 LOC (48%) 276 files
test29648 LOC (32%) 152 files
generated6342 LOC (6%) 1 files
build and deployment386 LOC (<1%) 19 files
other10628 LOC (11%) 375 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 ".*".
  • 276 files match defined criteria (44,765 lines of code, 100.0% vs. main code):
    • 185 *.go files (38,587 lines of code)
    • 60 *.css files (3,830 lines of code)
    • 21 *.ts files (1,743 lines of code)
    • 5 *.yaml files (330 lines of code)
    • 1 *.bash files (261 lines of code)
    • 4 *.js files (14 lines of code)
  • " *.go" is biggest, containing 86.2% of code.
  • " *.js" is smallest, containing 0.03% of code.


*.go38587 LOC (86%) 185 files
*.css3830 LOC (8%) 60 files
*.ts1743 LOC (3%) 21 files
*.yaml330 LOC (<1%) 5 files
*.bash261 LOC (<1%) 1 files
*.js14 LOC (<1%) 4 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
snap
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 152 files match defined criteria (29,648 lines of code, 66.2% vs. main code):
    • 136 *.go files (28,542 lines of code)
    • 9 *.ts files (661 lines of code)
    • 2 *.snap files (261 lines of code)
    • 3 *.sh files (172 lines of code)
    • 2 *.yaml files (12 lines of code)
  • " *.go" is biggest, containing 96.27% of code.
  • " *.yaml" is smallest, containing 0.04% of code.


*.go28542 LOC (96%) 136 files
*.ts661 LOC (2%) 9 files
*.snap261 LOC (<1%) 2 files
*.sh172 LOC (<1%) 3 files
*.yaml12 LOC (<1%) 2 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[-]lock[.]json".
  • 1 file matches defined criteria (6,342 lines of code, 14.2% vs. main code). All matches are in *.json files.


*.json6342 LOC (100%) 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[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 19 files match defined criteria (386 lines of code, 0.9% vs. main code). All matches are in *.sh files.


*.sh386 LOC (100%) 19 files
Other Code
mod
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 ".*[.]svg".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[.]stylelintignore".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 375 files match defined criteria (10,628 lines of code, 23.7% vs. main code):
    • 3 *.json files (6,451 lines of code)
    • 308 *.sql files (2,778 lines of code)
    • 27 *.md files (1,311 lines of code)
    • 1 *.mod files (52 lines of code)
    • 36 *.svg files (36 lines of code)
  • " *.json" is biggest, containing 60.7% of code.
  • " *.svg" is smallest, containing 0.34% of code.


*.json6451 LOC (60%) 3 files
*.sql2778 LOC (26%) 308 files
*.md1311 LOC (12%) 27 files
*.mod52 LOC (<1%) 1 files
*.svg36 LOC (<1%) 36 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
  • *.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
  • *.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
  • *.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
  • *.bash files are analyzed with ShellAnalyzer:
    • 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
  • *.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


2022-02-03 02:05