microsoft / FigmaSharp
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
plist
storyboard
xaml
nuspec
txt
resx
shproj
axml
  • 21 extensions are included in analyses: cs, html, csproj, plist, json, xml, storyboard, xaml, svg, nuspec, md, txt, js, resx, yml, css, shproj, gitignore, xib, sh, axml
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (11 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (6 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (144 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) (7 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.

main21591 LOC (41%) 353 files
test1072 LOC (2%) 20 files
generated599 LOC (1%) 21 files
build and deployment1312 LOC (2%) 27 files
other27607 LOC (52%) 273 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 353 files match defined criteria (21,591 lines of code, 100.0% vs. main code):
    • 349 *.cs files (21,510 lines of code)
    • 4 *.yml files (81 lines of code)
  • " *.cs" is biggest, containing 99.62% of code.
  • " *.yml" is smallest, containing 0.38% of code.


*.cs21510 LOC (99%) 349 files
*.yml81 LOC (<1%) 4 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 20 files match defined criteria (1,072 lines of code, 5.0% vs. main code):
    • 18 *.cs files (908 lines of code)
    • 2 *.csproj files (164 lines of code)
  • " *.cs" is biggest, containing 84.7% of code.
  • " *.csproj" is smallest, containing 15.3% of code.


*.cs908 LOC (84%) 18 files
*.csproj164 LOC (15%) 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
    • files with paths like ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
    • files with paths like ".*[.]designer[.](cs|vb)".
  • 21 files match defined criteria (599 lines of code, 2.8% vs. main code). All matches are in *.cs files.


*.cs599 LOC (100%) 21 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 ".*/[.]gitignore".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/AndroidManifest[.]xml".
  • 27 files match defined criteria (1,312 lines of code, 6.1% vs. main code):
    • 16 *.csproj files (1,079 lines of code)
    • 9 *.nuspec files (216 lines of code)
    • 2 *.sh files (17 lines of code)
  • " *.csproj" is biggest, containing 82.24% of code.
  • " *.sh" is smallest, containing 1.3% of code.


*.csproj1079 LOC (82%) 16 files
*.nuspec216 LOC (16%) 9 files
*.sh17 LOC (1%) 2 files
Other Code
csproj
storyboard
plist
xaml
shproj
axml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 273 files match defined criteria (27,607 lines of code, 127.9% vs. main code):
    • 27 *.json files (17,078 lines of code)
    • 126 *.cs files (3,798 lines of code)
    • 25 *.csproj files (3,023 lines of code)
    • 12 *.storyboard files (2,399 lines of code)
    • 32 *.plist files (671 lines of code)
    • 20 *.xml files (245 lines of code)
    • 7 *.md files (124 lines of code)
    • 2 *.xib files (86 lines of code)
    • 11 *.xaml files (80 lines of code)
    • 6 *.svg files (66 lines of code)
    • 3 *.shproj files (33 lines of code)
    • 2 *.axml files (4 lines of code)
  • " *.json" is biggest, containing 61.86% of code.
  • " *.axml" is smallest, containing 0.01% of code.


*.json17078 LOC (61%) 27 files
*.cs3798 LOC (13%) 126 files
*.csproj3023 LOC (10%) 25 files
*.storyboard2399 LOC (8%) 12 files
*.plist671 LOC (2%) 32 files
*.xml245 LOC (<1%) 20 files
*.md124 LOC (<1%) 7 files
*.xib86 LOC (<1%) 2 files
*.xaml80 LOC (<1%) 11 files
*.svg66 LOC (<1%) 6 files
*.shproj33 LOC (<1%) 3 files
*.axml4 LOC (<1%) 2 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


2022-01-30 22:32