microsoft / Mobius
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
cmd
txt
fs
fsproj
properties
gitattributes
fsx
xsl
tab
vcxproj
nuspec
  • 26 extensions are included in analyses: cs, scala, csproj, md, cmd, ps1, sh, txt, json, fs, xml, py, java, yml, h, fsproj, properties, gitattributes, fsx, xsl, tab, vcxproj, nuspec, cpp, gitignore, XML
  • 6 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 ".*/docs/.*" (Documentation) (2 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) (5 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.

main30075 LOC (60%) 232 files
test2349 LOC (4%) 24 files
generated0 LOC (0%) 0 files
build and deployment1237 LOC (2%) 16 files
other16390 LOC (32%) 83 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmd
vcxproj
fsx
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 232 files match defined criteria (30,075 lines of code, 100.0% vs. main code):
    • 184 *.cs files (24,324 lines of code)
    • 17 *.scala files (3,167 lines of code)
    • 9 *.ps1 files (961 lines of code)
    • 11 *.cmd files (641 lines of code)
    • 1 *.cpp files (510 lines of code)
    • 2 *.h files (148 lines of code)
    • 3 *.py files (124 lines of code)
    • 1 *.vcxproj files (91 lines of code)
    • 1 *.yml files (72 lines of code)
    • 1 *.fsx files (29 lines of code)
    • 2 *.java files (8 lines of code)
  • " *.cs" is biggest, containing 80.88% of code.
  • " *.java" is smallest, containing 0.03% of code.


*.cs24324 LOC (80%) 184 files
*.scala3167 LOC (10%) 17 files
*.ps1961 LOC (3%) 9 files
*.cmd641 LOC (2%) 11 files
*.cpp510 LOC (1%) 1 files
*.h148 LOC (<1%) 2 files
*.py124 LOC (<1%) 3 files
*.vcxproj91 LOC (<1%) 1 files
*.yml72 LOC (<1%) 1 files
*.fsx29 LOC (<1%) 1 files
*.java8 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/Mocks/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 24 files match defined criteria (2,349 lines of code, 7.8% vs. main code):
    • 14 *.cs files (1,304 lines of code)
    • 10 *.scala files (1,045 lines of code)
  • " *.cs" is biggest, containing 55.51% of code.
  • " *.scala" is smallest, containing 44.49% of code.


*.cs1304 LOC (55%) 14 files
*.scala1045 LOC (44%) 10 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 ".*[.]sh".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*/pom[.]xml".
  • 16 files match defined criteria (1,237 lines of code, 4.1% vs. main code):
    • 9 *.csproj files (914 lines of code)
    • 6 *.sh files (293 lines of code)
    • 1 *.nuspec files (30 lines of code)
  • " *.csproj" is biggest, containing 73.89% of code.
  • " *.nuspec" is smallest, containing 2.43% of code.


*.csproj914 LOC (73%) 9 files
*.sh293 LOC (23%) 6 files
*.nuspec30 LOC (2%) 1 files
Other Code
csproj
tab
fsproj
fs
cmd
xsl
properties
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 ".*[.]properties".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]tab".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 83 files match defined criteria (16,390 lines of code, 54.5% vs. main code):
    • 5 *.xml files (9,236 lines of code)
    • 37 *.cs files (4,880 lines of code)
    • 10 *.csproj files (819 lines of code)
    • 13 *.md files (651 lines of code)
    • 1 *.tab files (281 lines of code)
    • 2 *.fsproj files (197 lines of code)
    • 4 *.fs files (137 lines of code)
    • 2 *.cmd files (61 lines of code)
    • 2 *.sh files (43 lines of code)
    • 1 *.xsl files (37 lines of code)
    • 2 *.properties files (34 lines of code)
    • 4 *.json files (14 lines of code)
  • " *.xml" is biggest, containing 56.35% of code.
  • " *.json" is smallest, containing 0.09% of code.


*.xml9236 LOC (56%) 5 files
*.cs4880 LOC (29%) 37 files
*.csproj819 LOC (4%) 10 files
*.md651 LOC (3%) 13 files
*.tab281 LOC (1%) 1 files
*.fsproj197 LOC (1%) 2 files
*.fs137 LOC (<1%) 4 files
*.cmd61 LOC (<1%) 2 files
*.sh43 LOC (<1%) 2 files
*.xsl37 LOC (<1%) 1 files
*.properties34 LOC (<1%) 2 files
*.json14 LOC (<1%) 4 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)
  • *.scala files are analyzed with ScalaAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.py files are analyzed with PythonAnalyzer:
    • 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
  • *.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
  • *.fsx 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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 package names)


2022-01-30 11:13