microsoft / bedrock
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
properties
  • 15 extensions are included in analyses: tf, md, sh, yml, tfvars, go, svg, gitignore, txt, mod, py, toml, json, properties, yaml
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (25 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (16 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) (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.

main4163 LOC (40%) 122 files
test1690 LOC (16%) 16 files
generated0 LOC (0%) 0 files
build and deployment999 LOC (9%) 20 files
other3492 LOC (33%) 48 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 ".*".
  • 122 files match defined criteria (4,163 lines of code, 100.0% vs. main code):
    • 109 *.tf files (3,592 lines of code)
    • 3 *.yml files (384 lines of code)
    • 10 *.tfvars files (187 lines of code)
  • " *.tf" is biggest, containing 86.28% of code.
  • " *.tfvars" is smallest, containing 4.49% of code.


*.tf3592 LOC (86%) 109 files
*.yml384 LOC (9%) 3 files
*.tfvars187 LOC (4%) 10 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 ".*_test[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 16 files match defined criteria (1,690 lines of code, 40.6% vs. main code):
    • 5 *.go files (1,036 lines of code)
    • 6 *.sh files (490 lines of code)
    • 1 *.yaml files (81 lines of code)
    • 2 *.yml files (70 lines of code)
    • 1 *.py files (7 lines of code)
    • 1 *.toml files (6 lines of code)
  • " *.go" is biggest, containing 61.3% of code.
  • " *.toml" is smallest, containing 0.36% of code.


*.go1036 LOC (61%) 5 files
*.sh490 LOC (28%) 6 files
*.yaml81 LOC (4%) 1 files
*.yml70 LOC (4%) 2 files
*.py7 LOC (<1%) 1 files
*.toml6 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 20 files match defined criteria (999 lines of code, 24.0% vs. main code). All matches are in *.sh files.


*.sh999 LOC (100%) 20 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 ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]txt".
  • 48 files match defined criteria (3,492 lines of code, 83.9% vs. main code):
    • 45 *.md files (2,428 lines of code)
    • 1 *.svg files (1,012 lines of code)
    • 1 *.mod files (46 lines of code)
    • 1 *.properties files (6 lines of code)
  • " *.md" is biggest, containing 69.53% of code.
  • " *.properties" is smallest, containing 0.17% of code.


*.md2428 LOC (69%) 45 files
*.svg1012 LOC (28%) 1 files
*.mod46 LOC (1%) 1 files
*.properties6 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.tfvars 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


2022-01-30 22:28