bazelbuild / rules_dotnet
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
fs
txt
csproj
patch
resx
proto
cmd
xslt
  • 21 extensions are included in analyses: cs, bzl, md, c, fs, json, gitignore, txt, csproj, sh, bat, yml, h, scss, ps1, patch, resx, Dockerfile, proto, cmd, xslt
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (12 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (1 file).
    • exclude files with path like ".*/deps/.*" (Dependencies) (4 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (13 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 ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (5 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (5 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.

main36800 LOC (90%) 106 files
test1137 LOC (2%) 30 files
generated38 LOC (<1%) 1 files
build and deployment34 LOC (<1%) 2 files
other2509 LOC (6%) 40 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xslt
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 106 files match defined criteria (36,800 lines of code, 100.0% vs. main code):
    • 40 *.bzl files (31,045 lines of code)
    • 50 *.cs files (4,344 lines of code)
    • 11 *.c files (1,257 lines of code)
    • 1 *.xslt files (76 lines of code)
    • 2 *.h files (40 lines of code)
    • 1 *.cmd files (20 lines of code)
    • 1 *.ps1 files (18 lines of code)
  • " *.bzl" is biggest, containing 84.36% of code.
  • " *.ps1" is smallest, containing 0.05% of code.


*.bzl31045 LOC (84%) 40 files
*.cs4344 LOC (11%) 50 files
*.c1257 LOC (3%) 11 files
*.xslt76 LOC (<1%) 1 files
*.h40 LOC (<1%) 2 files
*.cmd20 LOC (<1%) 1 files
*.ps118 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
fs
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 30 files match defined criteria (1,137 lines of code, 3.1% vs. main code):
    • 22 *.cs files (1,046 lines of code)
    • 6 *.fs files (71 lines of code)
    • 2 *.csproj files (20 lines of code)
  • " *.cs" is biggest, containing 92% of code.
  • " *.csproj" is smallest, containing 1.76% of code.


*.cs1046 LOC (91%) 22 files
*.fs71 LOC (6%) 6 files
*.csproj20 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 1 file matches defined criteria (38 lines of code, 0.1% vs. main code). All matches are in *.cs files.


*.cs38 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]bat".
  • 2 files match defined criteria (34 lines of code, 0.1% vs. main code). All matches are in *.csproj files.


*.csproj34 LOC (100%) 2 files
Other Code
proto
csproj
fs
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 ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]patch".
  • 40 files match defined criteria (2,509 lines of code, 6.8% vs. main code):
    • 4 *.bzl files (1,816 lines of code)
    • 20 *.cs files (411 lines of code)
    • 3 *.md files (119 lines of code)
    • 5 *.json files (60 lines of code)
    • 1 *.proto files (28 lines of code)
    • 1 *.csproj files (24 lines of code)
    • 2 *.sh files (24 lines of code)
    • 2 *.fs files (15 lines of code)
    • 2 *.bat files (12 lines of code)
  • " *.bzl" is biggest, containing 72.38% of code.
  • " *.bat" is smallest, containing 0.48% of code.


*.bzl1816 LOC (72%) 4 files
*.cs411 LOC (16%) 20 files
*.md119 LOC (4%) 3 files
*.json60 LOC (2%) 5 files
*.proto28 LOC (1%) 1 files
*.csproj24 LOC (<1%) 1 files
*.sh24 LOC (<1%) 2 files
*.fs15 LOC (<1%) 2 files
*.bat12 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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 namespace heuristics)
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.xslt files are analyzed with XmlAnalyzer:
    • 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
  • *.h files are analyzed with CppAnalyzer:
    • 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
  • *.cmd 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
  • *.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


2022-02-03 05:29