azure / iot-operations-sdks
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
txt
mod
proto
cmd
gitattributes
editorconfig
props
jq
xsd
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.

main47706 LOC (34%) 688 files
test44314 LOC (31%) 713 files
generated6049 LOC (4%) 22 files
build and deployment1371 LOC (<1%) 26 files
other39358 LOC (28%) 652 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
xsd
jq
cmd
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 688 files match defined criteria (47,706 LOC, 100.0% vs. main code):
    • 440 *.cs files (19,256 LOC)
    • 112 *.rs files (16,745 LOC)
    • 98 *.go files (7,604 LOC)
    • 15 *.proto files (2,444 LOC)
    • 2 *.xml files (990 LOC)
    • 13 *.toml files (289 LOC)
    • 1 *.xsd files (156 LOC)
    • 2 *.yaml files (134 LOC)
    • 1 *.jq files (64 LOC)
    • 3 *.cmd files (15 LOC)
    • 1 *.props files (9 LOC)
  • " *.cs" is biggest, containing 40.36% of LOC.
  • " *.props" is smallest, containing 0.02% of LOC.


*.cs19256 LOC (40%) 440 files
*.rs16745 LOC (35%) 112 files
*.go7604 LOC (15%) 98 files
*.proto2444 LOC (5%) 15 files
*.xml990 LOC (2%) 2 files
*.toml289 LOC (<1%) 13 files
*.xsd156 LOC (<1%) 1 file
*.yaml134 LOC (<1%) 2 files
*.jq64 LOC (<1%) 1 file
*.cmd15 LOC (<1%) 3 files
*.props9 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
cmd
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.]UnitTests/.*".
    • files with paths like ".*UnitTests[.][a-zA-Z0-9_]+".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
  • 713 files match defined criteria (44,314 LOC, 92.9% vs. main code):
    • 231 *.cs files (21,885 LOC)
    • 62 *.rs files (8,123 LOC)
    • 282 *.yaml files (7,077 LOC)
    • 85 *.go files (6,158 LOC)
    • 12 *.csproj files (405 LOC)
    • 31 *.xml files (387 LOC)
    • 3 *.sh files (137 LOC)
    • 4 *.toml files (71 LOC)
    • 1 *.cmd files (59 LOC)
    • 1 *.props files (9 LOC)
    • 1 *.ps1 files (3 LOC)
  • " *.cs" is biggest, containing 49.39% of LOC.
  • " *.ps1" is smallest, containing 0.01% of LOC.


*.cs21885 LOC (49%) 231 files
*.rs8123 LOC (18%) 62 files
*.yaml7077 LOC (15%) 282 files
*.go6158 LOC (13%) 85 files
*.csproj405 LOC (<1%) 12 files
*.xml387 LOC (<1%) 31 files
*.sh137 LOC (<1%) 3 files
*.toml71 LOC (<1%) 4 files
*.cmd59 LOC (<1%) 1 file
*.props9 LOC (<1%) 1 file
*.ps13 LOC (<1%) 1 file
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/.*".
    • files with any line of content like "//[ ]*Generated by .*".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 22 files match defined criteria (6,049 LOC, 12.7% vs. main code):
    • 20 *.cs files (4,831 LOC)
    • 2 *.md files (1,218 LOC)
  • " *.cs" is biggest, containing 79.86% of LOC.
  • " *.md" is smallest, containing 20.14% of LOC.


*.cs4831 LOC (79%) 20 files
*.md1218 LOC (20%) 2 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/package[.]json".
  • 26 files match defined criteria (1,371 LOC, 2.9% vs. main code):
    • 7 *.csproj files (1,029 LOC)
    • 19 *.sh files (342 LOC)
  • " *.csproj" is biggest, containing 75.05% of LOC.
  • " *.sh" is smallest, containing 24.95% of LOC.


*.csproj1029 LOC (75%) 7 files
*.sh342 LOC (24%) 19 files
Other Code
mod
csproj
txt
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]editorconfig".
  • 652 files match defined criteria (39,358 LOC, 82.5% vs. main code):
    • 116 *.md files (11,948 LOC)
    • 197 *.cs files (11,499 LOC)
    • 175 *.json files (8,876 LOC)
    • 18 *.rs files (2,467 LOC)
    • 35 *.go files (2,281 LOC)
    • 17 *.yaml files (762 LOC)
    • 24 *.mod files (616 LOC)
    • 22 *.csproj files (346 LOC)
    • 19 *.sh files (257 LOC)
    • 23 *.txt files (183 LOC)
    • 1 *.js files (60 LOC)
    • 4 *.toml files (56 LOC)
    • 1 *.cmd files (7 LOC)
  • " *.md" is biggest, containing 30.36% of LOC.
  • " *.cmd" is smallest, containing 0.02% of LOC.


*.md11948 LOC (30%) 116 files
*.cs11499 LOC (29%) 197 files
*.json8876 LOC (22%) 175 files
*.rs2467 LOC (6%) 18 files
*.go2281 LOC (5%) 35 files
*.yaml762 LOC (1%) 17 files
*.mod616 LOC (1%) 24 files
*.csproj346 LOC (<1%) 22 files
*.sh257 LOC (<1%) 19 files
*.txt183 LOC (<1%) 23 files
*.js60 LOC (<1%) 1 file
*.toml56 LOC (<1%) 4 files
*.cmd7 LOC (<1%) 1 file
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)
  • *.rs files are analyzed with RustAnalyzer:
    • 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
    • No dependency analysis
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
  • *.proto 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
  • *.xml 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
  • *.toml 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
  • *.xsd 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
  • *.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
  • *.jq 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
  • *.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


2025-05-06 23:15