microsoft / Vipr
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
csproj
nuspec
resx
proj
cmd
targets
txt
DotSettings
  • 16 extensions are included in analyses: cs, xml, csproj, nuspec, resx, md, json, proj, yml, cmd, gitignore, targets, txt, groovy, bat, DotSettings
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (4 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) (0 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.

main5406 LOC (23%) 65 files
test6100 LOC (26%) 15 files
generated291 LOC (1%) 4 files
build and deployment170 LOC (<1%) 6 files
other10718 LOC (47%) 61 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmd
proj
targets
dotsettings
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 65 files match defined criteria (5,406 lines of code, 100.0% vs. main code):
    • 58 *.cs files (5,274 lines of code)
    • 2 *.cmd files (52 lines of code)
    • 2 *.proj files (38 lines of code)
    • 1 *.groovy files (21 lines of code)
    • 1 *.targets files (15 lines of code)
    • 1 *.dotsettings files (6 lines of code)
  • " *.cs" is biggest, containing 97.56% of code.
  • " *.dotsettings" is smallest, containing 0.11% of code.


*.cs5274 LOC (97%) 58 files
*.cmd52 LOC (<1%) 2 files
*.proj38 LOC (<1%) 2 files
*.groovy21 LOC (<1%) 1 files
*.targets15 LOC (<1%) 1 files
*.dotsettings6 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 15 files match defined criteria (6,100 lines of code, 112.8% vs. main code):
    • 14 *.cs files (6,034 lines of code)
    • 1 *.csproj files (66 lines of code)
  • " *.cs" is biggest, containing 98.92% of code.
  • " *.csproj" is smallest, containing 1.08% of code.


*.cs6034 LOC (98%) 14 files
*.csproj66 LOC (1%) 1 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 "[/][/][ ]*".
  • 4 files match defined criteria (291 lines of code, 5.4% vs. main code). All matches are in *.cs files.


*.cs291 LOC (100%) 4 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
nuspec
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 ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]bat".
  • 6 files match defined criteria (170 lines of code, 3.1% vs. main code):
    • 3 *.csproj files (95 lines of code)
    • 3 *.nuspec files (75 lines of code)
  • " *.csproj" is biggest, containing 55.88% of code.
  • " *.nuspec" is smallest, containing 44.12% of code.


*.csproj95 LOC (55%) 3 files
*.nuspec75 LOC (44%) 3 files
Other Code
csproj
nuspec
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 ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 61 files match defined criteria (10,718 lines of code, 198.3% vs. main code):
    • 17 *.cs files (8,687 lines of code)
    • 33 *.xml files (1,278 lines of code)
    • 5 *.csproj files (542 lines of code)
    • 3 *.md files (158 lines of code)
    • 2 *.nuspec files (50 lines of code)
    • 1 *.bat files (3 lines of code)
  • " *.cs" is biggest, containing 81.05% of code.
  • " *.bat" is smallest, containing 0.03% of code.


*.cs8687 LOC (81%) 17 files
*.xml1278 LOC (11%) 33 files
*.csproj542 LOC (5%) 5 files
*.md158 LOC (1%) 3 files
*.nuspec50 LOC (<1%) 2 files
*.bat3 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.proj 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
  • *.groovy files are analyzed with GroovyAnalyzer:
    • 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
  • *.targets 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
  • *.dotsettings 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


2022-01-30 09:28