azure / azure-iot-sdk-csharp
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
http
resx
txt
xaml
cfg
axml
cmd
plist
reg
gitattributes
editorconfig
storyboard
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.

main54030 LOC (52%) 602 files
test31477 LOC (30%) 218 files
generated3506 LOC (3%) 19 files
build and deployment830 LOC (<1%) 10 files
other13374 LOC (12%) 256 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
reg
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 602 files match defined criteria (54,030 LOC, 100.0% vs. main code):
    • 585 *.cs files (52,076 LOC)
    • 10 *.ps1 files (1,113 LOC)
    • 4 *.yaml files (766 LOC)
    • 2 *.reg files (64 LOC)
    • 1 *.cmd files (11 LOC)
  • " *.cs" is biggest, containing 96.38% of LOC.
  • " *.cmd" is smallest, containing 0.02% of LOC.


*.cs52076 LOC (96%) 585 files
*.ps11113 LOC (2%) 10 files
*.yaml766 LOC (1%) 4 files
*.reg64 LOC (<1%) 2 files
*.cmd11 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
cfg
http
cmd
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 ".*/e2e/.*".
    • files with paths like ".*/[Tt]est/.*".
  • 218 files match defined criteria (31,477 LOC, 58.3% vs. main code):
    • 188 *.cs files (30,115 LOC)
    • 5 *.ps1 files (781 LOC)
    • 12 *.csproj files (313 LOC)
    • 3 *.cfg files (102 LOC)
    • 1 *.sh files (83 LOC)
    • 7 *.http files (49 LOC)
    • 2 *.cmd files (34 LOC)
  • " *.cs" is biggest, containing 95.67% of LOC.
  • " *.cmd" is smallest, containing 0.11% of LOC.


*.cs30115 LOC (95%) 188 files
*.ps1781 LOC (2%) 5 files
*.csproj313 LOC (<1%) 12 files
*.cfg102 LOC (<1%) 3 files
*.sh83 LOC (<1%) 1 file
*.http49 LOC (<1%) 7 files
*.cmd34 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 ".*[.]cs" AND any line of content like "[/][/][ ]*".
    • files with paths like ".*[.]designer[.](cs|vb)".
    • files with paths like ".*/generated/.*".
  • 19 files match defined criteria (3,506 LOC, 6.5% vs. main code). All matches are in *.cs files.


*.cs3506 LOC (100%) 19 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]csproj".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 10 files match defined criteria (830 LOC, 1.5% vs. main code). All matches are in *.csproj files.


*.csproj830 LOC (100%) 10 files
Other Code
csproj
txt
xaml
plist
storyboard
axml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]editorconfig".
  • 256 files match defined criteria (13,374 LOC, 24.8% vs. main code):
    • 132 *.cs files (8,115 LOC)
    • 44 *.md files (1,748 LOC)
    • 14 *.json files (1,740 LOC)
    • 44 *.csproj files (1,077 LOC)
    • 3 *.ps1 files (278 LOC)
    • 5 *.txt files (182 LOC)
    • 4 *.xaml files (81 LOC)
    • 2 *.plist files (60 LOC)
    • 1 *.storyboard files (38 LOC)
    • 4 *.xml files (32 LOC)
    • 3 *.axml files (23 LOC)
  • " *.cs" is biggest, containing 60.68% of LOC.
  • " *.axml" is smallest, containing 0.17% of LOC.


*.cs8115 LOC (60%) 132 files
*.md1748 LOC (13%) 44 files
*.json1740 LOC (13%) 14 files
*.csproj1077 LOC (8%) 44 files
*.ps1278 LOC (2%) 3 files
*.txt182 LOC (1%) 5 files
*.xaml81 LOC (<1%) 4 files
*.plist60 LOC (<1%) 2 files
*.storyboard38 LOC (<1%) 1 file
*.xml32 LOC (<1%) 4 files
*.axml23 LOC (<1%) 3 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)
  • *.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
  • *.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
  • *.reg 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


2025-05-06 21:18