microsoft / Tx
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
resx
man
txt
cmd
nuspec
xaml
targets
  • 17 extensions are included in analyses: cs, csproj, md, xml, resx, man, txt, cmd, nuspec, xaml, ps1, bat, json, gitignore, targets, sql, yml
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (3 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (10 files).
    • exclude files with path like ".*/[Pp]ackages\/.+\.\d+\/.*" (NuGet) (14 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).
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.

main34325 LOC (63%) 203 files
test3551 LOC (6%) 52 files
generated399 LOC (<1%) 14 files
build and deployment446 LOC (<1%) 11 files
other15590 LOC (28%) 269 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
man
xaml
targets
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 203 files match defined criteria (34,325 lines of code, 100.0% vs. main code):
    • 188 *.cs files (25,823 lines of code)
    • 5 *.man files (5,101 lines of code)
    • 3 *.xml files (3,199 lines of code)
    • 1 *.xaml files (71 lines of code)
    • 1 *.ps1 files (63 lines of code)
    • 1 *.targets files (45 lines of code)
    • 4 *.cmd files (23 lines of code)
  • " *.cs" is biggest, containing 75.23% of code.
  • " *.cmd" is smallest, containing 0.07% of code.


*.cs25823 LOC (75%) 188 files
*.man5101 LOC (14%) 5 files
*.xml3199 LOC (9%) 3 files
*.xaml71 LOC (<1%) 1 files
*.ps163 LOC (<1%) 1 files
*.targets45 LOC (<1%) 1 files
*.cmd23 LOC (<1%) 4 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]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/[Tt]est/.*".
  • 52 files match defined criteria (3,551 lines of code, 10.3% vs. main code):
    • 46 *.cs files (3,289 lines of code)
    • 6 *.csproj files (262 lines of code)
  • " *.cs" is biggest, containing 92.62% of code.
  • " *.csproj" is smallest, containing 7.38% of code.


*.cs3289 LOC (92%) 46 files
*.csproj262 LOC (7%) 6 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 "[/][/][ ]*".
  • 14 files match defined criteria (399 lines of code, 1.2% vs. main code). All matches are in *.cs files.


*.cs399 LOC (100%) 14 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".
  • 11 files match defined criteria (446 lines of code, 1.3% vs. main code):
    • 10 *.csproj files (427 lines of code)
    • 1 *.nuspec files (19 lines of code)
  • " *.csproj" is biggest, containing 95.74% of code.
  • " *.nuspec" is smallest, containing 4.26% of code.


*.csproj427 LOC (95%) 10 files
*.nuspec19 LOC (4%) 1 files
Other Code
csproj
man
xaml
txt
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]json".
  • 269 files match defined criteria (15,590 lines of code, 45.4% vs. main code):
    • 171 *.cs files (8,529 lines of code)
    • 43 *.csproj files (2,806 lines of code)
    • 2 *.man files (1,895 lines of code)
    • 30 *.md files (1,187 lines of code)
    • 6 *.xml files (942 lines of code)
    • 3 *.xaml files (74 lines of code)
    • 6 *.txt files (56 lines of code)
    • 2 *.bat files (42 lines of code)
    • 3 *.cmd files (25 lines of code)
    • 1 *.sql files (20 lines of code)
    • 2 *.json files (14 lines of code)
  • " *.cs" is biggest, containing 54.71% of code.
  • " *.json" is smallest, containing 0.09% of code.


*.cs8529 LOC (54%) 171 files
*.csproj2806 LOC (17%) 43 files
*.man1895 LOC (12%) 2 files
*.md1187 LOC (7%) 30 files
*.xml942 LOC (6%) 6 files
*.xaml74 LOC (<1%) 3 files
*.txt56 LOC (<1%) 6 files
*.bat42 LOC (<1%) 2 files
*.cmd25 LOC (<1%) 3 files
*.sql20 LOC (<1%) 1 files
*.json14 LOC (<1%) 2 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)
  • *.man 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
  • *.xml 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
  • *.xaml 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
  • *.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
  • *.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
  • *.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


2022-01-30 07:31