microsoft / XamlBehaviors
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
xlf
csproj
resx
vcxproj
targets
nuspec
filters
props
gitattributes
editorconfig
txt
cmd
  • 22 extensions are included in analyses: cs, xaml, h, xlf, cpp, csproj, xml, resx, vcxproj, md, targets, json, yml, nuspec, filters, props, gitattributes, ps1, editorconfig, gitignore, txt, cmd
  • 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) (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.

main8381 LOC (40%) 155 files
test2083 LOC (10%) 22 files
generated1096 LOC (5%) 12 files
build and deployment1402 LOC (6%) 12 files
other7509 LOC (36%) 123 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xlf
vcxproj
filters
targets
props
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 155 files match defined criteria (8,381 lines of code, 100.0% vs. main code):
    • 58 *.cs files (3,360 lines of code)
    • 44 *.xlf files (2,116 lines of code)
    • 16 *.cpp files (1,303 lines of code)
    • 2 *.vcxproj files (706 lines of code)
    • 27 *.h files (683 lines of code)
    • 2 *.filters files (144 lines of code)
    • 2 *.targets files (48 lines of code)
    • 1 *.ps1 files (10 lines of code)
    • 2 *.props files (10 lines of code)
    • 1 *.cmd files (1 lines of code)
  • " *.cs" is biggest, containing 40.09% of code.
  • " *.cmd" is smallest, containing 0.01% of code.


*.cs3360 LOC (40%) 58 files
*.xlf2116 LOC (25%) 44 files
*.cpp1303 LOC (15%) 16 files
*.vcxproj706 LOC (8%) 2 files
*.h683 LOC (8%) 27 files
*.filters144 LOC (1%) 2 files
*.targets48 LOC (<1%) 2 files
*.ps110 LOC (<1%) 1 files
*.props10 LOC (<1%) 2 files
*.cmd1 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
xaml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 22 files match defined criteria (2,083 lines of code, 24.9% vs. main code):
    • 17 *.cs files (1,693 lines of code)
    • 2 *.csproj files (365 lines of code)
    • 3 *.xaml files (25 lines of code)
  • " *.cs" is biggest, containing 81.28% of code.
  • " *.xaml" is smallest, containing 1.2% of code.


*.cs1693 LOC (81%) 17 files
*.csproj365 LOC (17%) 2 files
*.xaml25 LOC (1%) 3 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 "[/][/][ ]*".
  • 12 files match defined criteria (1,096 lines of code, 13.1% vs. main code). All matches are in *.cs files.


*.cs1096 LOC (100%) 12 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
  • 12 files match defined criteria (1,402 lines of code, 16.7% vs. main code):
    • 10 *.csproj files (1,293 lines of code)
    • 2 *.nuspec files (109 lines of code)
  • " *.csproj" is biggest, containing 92.23% of code.
  • " *.nuspec" is smallest, containing 7.77% of code.


*.csproj1293 LOC (92%) 10 files
*.nuspec109 LOC (7%) 2 files
Other Code
xaml
vcxproj
csproj
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 ".*[.]editorconfig".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 123 files match defined criteria (7,509 lines of code, 89.6% vs. main code):
    • 57 *.xaml files (5,052 lines of code)
    • 19 *.cs files (736 lines of code)
    • 18 *.cpp files (521 lines of code)
    • 1 *.vcxproj files (391 lines of code)
    • 1 *.csproj files (317 lines of code)
    • 18 *.h files (288 lines of code)
    • 3 *.md files (160 lines of code)
    • 5 *.xml files (25 lines of code)
    • 1 *.json files (19 lines of code)
  • " *.xaml" is biggest, containing 67.28% of code.
  • " *.json" is smallest, containing 0.25% of code.


*.xaml5052 LOC (67%) 57 files
*.cs736 LOC (9%) 19 files
*.cpp521 LOC (6%) 18 files
*.vcxproj391 LOC (5%) 1 files
*.csproj317 LOC (4%) 1 files
*.h288 LOC (3%) 18 files
*.md160 LOC (2%) 3 files
*.xml25 LOC (<1%) 5 files
*.json19 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)
  • *.xlf 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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 10:25