microsoft / bond
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
txt
csproj
hs
cmake
nuspec
targets
props
xaml
gitattributes
cabal
DotSettings
ini
el
gitmodules
properties
  • 32 extensions are included in analyses: h, cs, cpp, java, txt, csproj, hs, json, xml, gradle, md, cmake, gitignore, py, zsh, ps1, nuspec, targets, props, groovy, yml, xaml, gitattributes, cabal, html, yaml, css, DotSettings, ini, el, gitmodules, properties
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (44 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (3 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) (70 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.

main40979 LOC (34%) 374 files
test31502 LOC (26%) 194 files
generated30835 LOC (25%) 336 files
build and deployment617 LOC (<1%) 21 files
other14847 LOC (12%) 205 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
hs
cmake
targets
cabal
props
xaml
dotsettings
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 374 files match defined criteria (40,979 lines of code, 100.0% vs. main code):
    • 112 *.h files (15,449 lines of code)
    • 89 *.cs files (9,735 lines of code)
    • 80 *.java files (8,181 lines of code)
    • 32 *.hs files (5,156 lines of code)
    • 13 *.cmake files (580 lines of code)
    • 5 *.ps1 files (362 lines of code)
    • 7 *.py files (289 lines of code)
    • 1 *.yml files (223 lines of code)
    • 5 *.targets files (215 lines of code)
    • 1 *.cabal files (160 lines of code)
    • 9 *.zsh files (138 lines of code)
    • 2 *.yaml files (129 lines of code)
    • 4 *.groovy files (120 lines of code)
    • 4 *.props files (82 lines of code)
    • 5 *.cpp files (72 lines of code)
    • 3 *.xaml files (65 lines of code)
    • 1 *.dotsettings files (14 lines of code)
    • 1 *.css files (9 lines of code)
  • " *.h" is biggest, containing 37.7% of code.
  • " *.css" is smallest, containing 0.02% of code.


*.h15449 LOC (37%) 112 files
*.cs9735 LOC (23%) 89 files
*.java8181 LOC (19%) 80 files
*.hs5156 LOC (12%) 32 files
*.cmake580 LOC (1%) 13 files
*.ps1362 LOC (<1%) 5 files
*.py289 LOC (<1%) 7 files
*.yml223 LOC (<1%) 1 files
*.targets215 LOC (<1%) 5 files
*.cabal160 LOC (<1%) 1 files
*.zsh138 LOC (<1%) 9 files
*.yaml129 LOC (<1%) 2 files
*.groovy120 LOC (<1%) 4 files
*.props82 LOC (<1%) 4 files
*.cpp72 LOC (<1%) 5 files
*.xaml65 LOC (<1%) 3 files
*.dotsettings14 LOC (<1%) 1 files
*.css9 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
hs
csproj
cmake
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 194 files match defined criteria (31,502 lines of code, 76.9% vs. main code):
    • 42 *.java files (12,373 lines of code)
    • 49 *.cs files (7,924 lines of code)
    • 49 *.cpp files (7,465 lines of code)
    • 31 *.h files (2,065 lines of code)
    • 5 *.hs files (707 lines of code)
    • 13 *.csproj files (453 lines of code)
    • 2 *.py files (404 lines of code)
    • 1 *.ps1 files (59 lines of code)
    • 2 *.cmake files (52 lines of code)
  • " *.java" is biggest, containing 39.28% of code.
  • " *.cmake" is smallest, containing 0.17% of code.


*.java12373 LOC (39%) 42 files
*.cs7924 LOC (25%) 49 files
*.cpp7465 LOC (23%) 49 files
*.h2065 LOC (6%) 31 files
*.hs707 LOC (2%) 5 files
*.csproj453 LOC (1%) 13 files
*.py404 LOC (1%) 2 files
*.ps159 LOC (<1%) 1 files
*.cmake52 LOC (<1%) 2 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 ".*/generated/.*".
  • 336 files match defined criteria (30,835 lines of code, 75.2% vs. main code):
    • 175 *.h files (19,547 lines of code)
    • 12 *.java files (3,799 lines of code)
    • 93 *.cpp files (3,290 lines of code)
    • 44 *.cs files (3,151 lines of code)
    • 12 *.json files (1,048 lines of code)
  • " *.h" is biggest, containing 63.39% of code.
  • " *.json" is smallest, containing 3.4% of code.


*.h19547 LOC (63%) 175 files
*.java3799 LOC (12%) 12 files
*.cpp3290 LOC (10%) 93 files
*.cs3151 LOC (10%) 44 files
*.json1048 LOC (3%) 12 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
nuspec
csproj
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 ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/package[.]json".
  • 21 files match defined criteria (617 lines of code, 1.5% vs. main code):
    • 6 *.nuspec files (284 lines of code)
    • 7 *.csproj files (183 lines of code)
    • 8 *.gradle files (150 lines of code)
  • " *.nuspec" is biggest, containing 46.03% of code.
  • " *.gradle" is smallest, containing 24.31% of code.


*.nuspec284 LOC (46%) 6 files
*.csproj183 LOC (29%) 7 files
*.gradle150 LOC (24%) 8 files
Other Code
csproj
hs
cabal
ini
cmake
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 ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 205 files match defined criteria (14,847 lines of code, 36.2% vs. main code):
    • 21 *.md files (6,381 lines of code)
    • 46 *.cpp files (2,502 lines of code)
    • 37 *.cs files (1,566 lines of code)
    • 32 *.csproj files (1,438 lines of code)
    • 22 *.json files (1,217 lines of code)
    • 14 *.java files (474 lines of code)
    • 14 *.gradle files (448 lines of code)
    • 10 *.h files (415 lines of code)
    • 2 *.xml files (239 lines of code)
    • 2 *.hs files (96 lines of code)
    • 1 *.py files (24 lines of code)
    • 1 *.cabal files (17 lines of code)
    • 1 *.ini files (16 lines of code)
    • 1 *.cmake files (13 lines of code)
    • 1 *.properties files (1 lines of code)
  • " *.md" is biggest, containing 42.98% of code.
  • " *.properties" is smallest, containing 0.01% of code.


*.md6381 LOC (42%) 21 files
*.cpp2502 LOC (16%) 46 files
*.cs1566 LOC (10%) 37 files
*.csproj1438 LOC (9%) 32 files
*.json1217 LOC (8%) 22 files
*.java474 LOC (3%) 14 files
*.gradle448 LOC (3%) 14 files
*.h415 LOC (2%) 10 files
*.xml239 LOC (1%) 2 files
*.hs96 LOC (<1%) 2 files
*.py24 LOC (<1%) 1 files
*.cabal17 LOC (<1%) 1 files
*.ini16 LOC (<1%) 1 files
*.cmake13 LOC (<1%) 1 files
*.properties1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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)
  • *.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)
  • *.hs 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
  • *.cmake 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.cabal 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
  • *.zsh files are analyzed with ShellAnalyzer:
    • 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
  • *.yaml 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
  • *.groovy files are analyzed with GroovyAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.dotsettings 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
  • *.css files are analyzed with CssAnalyzer:
    • 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 09:27