microsoft / TemplateStudio
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
xaml
vstemplate
csproj
resx
txt
vbproj
editorconfig
vcxproj
props
filters
gitmodules
vsixmanifest
gitattributes
  • 28 extensions are included in analyses: json, md, cs, xaml, vb, vstemplate, csproj, resx, xml, js, svg, txt, ps1, vbproj, bat, cpp, h, editorconfig, yml, vcxproj, props, filters, html, gitignore, css, gitmodules, vsixmanifest, gitattributes
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8708 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (79 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (214 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) (27 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.

main115616 LOC (70%) 3254 files
test29254 LOC (17%) 468 files
generated1336 LOC (<1%) 7 files
build and deployment6455 LOC (3%) 69 files
other12061 LOC (7%) 659 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xaml
vstemplate
vcxproj
filters
vsixmanifest
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 3254 files match defined criteria (115,616 lines of code, 100.0% vs. main code):
    • 1,624 *.cs files (58,483 lines of code)
    • 738 *.xaml files (27,703 lines of code)
    • 512 *.vb files (15,832 lines of code)
    • 322 *.vstemplate files (11,088 lines of code)
    • 18 *.ps1 files (978 lines of code)
    • 3 *.vcxproj files (438 lines of code)
    • 2 *.yml files (333 lines of code)
    • 13 *.cpp files (274 lines of code)
    • 13 *.h files (215 lines of code)
    • 3 *.filters files (124 lines of code)
    • 2 *.html files (77 lines of code)
    • 1 *.vsixmanifest files (50 lines of code)
    • 3 *.props files (21 lines of code)
  • " *.cs" is biggest, containing 50.58% of code.
  • " *.props" is smallest, containing 0.02% of code.


*.cs58483 LOC (50%) 1624 files
*.xaml27703 LOC (23%) 738 files
*.vb15832 LOC (13%) 512 files
*.vstemplate11088 LOC (9%) 322 files
*.ps1978 LOC (<1%) 18 files
*.vcxproj438 LOC (<1%) 3 files
*.yml333 LOC (<1%) 2 files
*.cpp274 LOC (<1%) 13 files
*.h215 LOC (<1%) 13 files
*.filters124 LOC (<1%) 3 files
*.html77 LOC (<1%) 2 files
*.vsixmanifest50 LOC (<1%) 1 files
*.props21 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
xaml
csproj
vbproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*[.]tests[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/TestData/.*".
    • files with paths like ".*/[Ss]pecs/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 468 files match defined criteria (29,254 lines of code, 25.3% vs. main code):
    • 348 *.cs files (18,936 lines of code)
    • 31 *.xaml files (6,908 lines of code)
    • 32 *.csproj files (1,672 lines of code)
    • 3 *.yml files (566 lines of code)
    • 12 *.vbproj files (531 lines of code)
    • 31 *.vb files (358 lines of code)
    • 11 *.bat files (283 lines of code)
  • " *.cs" is biggest, containing 64.73% of code.
  • " *.bat" is smallest, containing 0.97% of code.


*.cs18936 LOC (64%) 348 files
*.xaml6908 LOC (23%) 31 files
*.csproj1672 LOC (5%) 32 files
*.yml566 LOC (1%) 3 files
*.vbproj531 LOC (1%) 12 files
*.vb358 LOC (1%) 31 files
*.bat283 LOC (<1%) 11 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 "[/][/][ ]*".
  • 7 files match defined criteria (1,336 lines of code, 1.2% vs. main code). All matches are in *.cs files.


*.cs1336 LOC (100%) 7 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
vbproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]vbproj".
  • 69 files match defined criteria (6,455 lines of code, 5.6% vs. main code):
    • 61 *.csproj files (6,172 lines of code)
    • 6 *.vbproj files (271 lines of code)
    • 2 *.bat files (12 lines of code)
  • " *.csproj" is biggest, containing 95.62% of code.
  • " *.bat" is smallest, containing 0.19% of code.


*.csproj6172 LOC (95%) 61 files
*.vbproj271 LOC (4%) 6 files
*.bat12 LOC (<1%) 2 files
Other Code
xaml
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 659 files match defined criteria (12,061 lines of code, 10.4% vs. main code):
    • 78 *.cs files (3,367 lines of code)
    • 111 *.json files (2,801 lines of code)
    • 342 *.md files (1,820 lines of code)
    • 34 *.xaml files (1,267 lines of code)
    • 61 *.xml files (1,026 lines of code)
    • 4 *.csproj files (990 lines of code)
    • 29 *.svg files (790 lines of code)
  • " *.cs" is biggest, containing 27.92% of code.
  • " *.svg" is smallest, containing 6.55% of code.


*.cs3367 LOC (27%) 78 files
*.json2801 LOC (23%) 111 files
*.md1820 LOC (15%) 342 files
*.xaml1267 LOC (10%) 34 files
*.xml1026 LOC (8%) 61 files
*.csproj990 LOC (8%) 4 files
*.svg790 LOC (6%) 29 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)
  • *.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
  • *.vb files are analyzed with VisualBasicAnalyzer:
    • 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
  • *.vstemplate 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
  • *.vcxproj 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
  • *.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
  • *.cpp 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
  • *.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
  • *.filters 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.vsixmanifest 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
  • *.props 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 14:31