microsoft / MIEngine
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
vcxproj
properties
filters
targets
resx
txt
cmd
nuspec
plist
xsd
csx
editorconfig
natvis
vsixmanifest
gitattributes
xaml
  • 30 extensions are included in analyses: cs, xml, h, cpp, yml, csproj, vcxproj, c, properties, filters, targets, resx, txt, cmd, json, sh, nuspec, plist, gitignore, ps1, xsd, csx, MD, md, editorconfig, natvis, vsixmanifest, gitattributes, hpp, xaml
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (10 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) (9 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.

main42371 LOC (51%) 317 files
test26820 LOC (32%) 332 files
generated3984 LOC (4%) 11 files
build and deployment1347 LOC (1%) 25 files
other7020 LOC (8%) 102 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
natvis
xaml
targets
cmd
csx
vsixmanifest
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 317 files match defined criteria (42,371 lines of code, 100.0% vs. main code):
    • 258 *.cs files (39,354 lines of code)
    • 34 *.yml files (793 lines of code)
    • 1 *.natvis files (711 lines of code)
    • 1 *.xaml files (552 lines of code)
    • 14 *.targets files (402 lines of code)
    • 5 *.cmd files (253 lines of code)
    • 1 *.csx files (228 lines of code)
    • 1 *.ps1 files (42 lines of code)
    • 1 *.vsixmanifest files (26 lines of code)
    • 1 *.md files (10 lines of code)
  • " *.cs" is biggest, containing 92.88% of code.
  • " *.md" is smallest, containing 0.02% of code.


*.cs39354 LOC (92%) 258 files
*.yml793 LOC (1%) 34 files
*.natvis711 LOC (1%) 1 files
*.xaml552 LOC (1%) 1 files
*.targets402 LOC (<1%) 14 files
*.cmd253 LOC (<1%) 5 files
*.csx228 LOC (<1%) 1 files
*.ps142 LOC (<1%) 1 files
*.vsixmanifest26 LOC (<1%) 1 files
*.md10 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
vcxproj
cmd
csproj
filters
nuspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 332 files match defined criteria (26,820 lines of code, 63.3% vs. main code):
    • 153 *.cs files (11,607 lines of code)
    • 17 *.c files (5,865 lines of code)
    • 50 *.cpp files (3,490 lines of code)
    • 17 *.vcxproj files (3,143 lines of code)
    • 66 *.h files (1,878 lines of code)
    • 4 *.cmd files (301 lines of code)
    • 6 *.csproj files (229 lines of code)
    • 15 *.filters files (191 lines of code)
    • 1 *.ps1 files (65 lines of code)
    • 2 *.nuspec files (47 lines of code)
    • 1 *.hpp files (4 lines of code)
  • " *.cs" is biggest, containing 43.28% of code.
  • " *.hpp" is smallest, containing 0.01% of code.


*.cs11607 LOC (43%) 153 files
*.c5865 LOC (21%) 17 files
*.cpp3490 LOC (13%) 50 files
*.vcxproj3143 LOC (11%) 17 files
*.h1878 LOC (7%) 66 files
*.cmd301 LOC (1%) 4 files
*.csproj229 LOC (<1%) 6 files
*.filters191 LOC (<1%) 15 files
*.ps165 LOC (<1%) 1 files
*.nuspec47 LOC (<1%) 2 files
*.hpp4 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 "[/][/][ ]*".
    • files with paths like ".*[.]designer[.](cs|vb)".
  • 11 files match defined criteria (3,984 lines of code, 9.4% vs. main code). All matches are in *.cs files.


*.cs3984 LOC (100%) 11 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 ".*[.]nuspec".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*/build[.]xml".
  • 25 files match defined criteria (1,347 lines of code, 3.2% vs. main code):
    • 18 *.csproj files (1,129 lines of code)
    • 5 *.sh files (179 lines of code)
    • 2 *.nuspec files (39 lines of code)
  • " *.csproj" is biggest, containing 83.82% of code.
  • " *.nuspec" is smallest, containing 2.9% of code.


*.csproj1129 LOC (83%) 18 files
*.sh179 LOC (13%) 5 files
*.nuspec39 LOC (2%) 2 files
Other Code
xsd
plist
properties
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 ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 102 files match defined criteria (7,020 lines of code, 16.6% vs. main code):
    • 74 *.xml files (5,089 lines of code)
    • 2 *.xsd files (1,319 lines of code)
    • 5 *.json files (484 lines of code)
    • 3 *.plist files (52 lines of code)
    • 17 *.properties files (45 lines of code)
    • 1 *.md files (31 lines of code)
  • " *.xml" is biggest, containing 72.49% of code.
  • " *.md" is smallest, containing 0.44% of code.


*.xml5089 LOC (72%) 74 files
*.xsd1319 LOC (18%) 2 files
*.json484 LOC (6%) 5 files
*.plist52 LOC (<1%) 3 files
*.properties45 LOC (<1%) 17 files
*.md31 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)
  • *.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
  • *.natvis 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
  • *.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
  • *.csx 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)
  • *.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
  • *.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
  • *.md 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:16