azure / sonic-swss-common.msft
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
lua
yang
txt
i
cfg
m4
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.

main15463 LOC (60%) 163 files
test9216 LOC (35%) 56 files
generated0 LOC (0%) 0 files
build and deployment3 LOC (<1%) 1 file
other990 LOC (3%) 13 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
i
lua
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 163 files match defined criteria (15,463 LOC, 100.0% vs. main code):
    • 68 *.cpp files (9,294 LOC)
    • 83 *.h files (5,252 LOC)
    • 2 *.i files (654 LOC)
    • 7 *.lua files (246 LOC)
    • 1 *.cfg files (15 LOC)
    • 2 *.py files (2 LOC)
  • " *.cpp" is biggest, containing 60.1% of LOC.
  • " *.py" is smallest, containing 0.01% of LOC.


*.cpp9294 LOC (60%) 68 files
*.h5252 LOC (33%) 83 files
*.i654 LOC (4%) 2 files
*.lua246 LOC (1%) 7 files
*.cfg15 LOC (<1%) 1 file
*.py2 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
yang
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
  • 56 files match defined criteria (9,216 LOC, 59.6% vs. main code):
    • 42 *.cpp files (7,941 LOC)
    • 7 *.py files (1,000 LOC)
    • 5 *.yang files (236 LOC)
    • 1 *.go files (32 LOC)
    • 1 *.h files (7 LOC)
  • " *.cpp" is biggest, containing 86.17% of LOC.
  • " *.h" is smallest, containing 0.08% of LOC.


*.cpp7941 LOC (86%) 42 files
*.py1000 LOC (10%) 7 files
*.yang236 LOC (2%) 5 files
*.go32 LOC (<1%) 1 file
*.h7 LOC (<1%) 1 file
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*[.]sh".
  • 1 file matches defined criteria (3 LOC, 0.0% vs. main code). All matches are in *.sh files.


*.sh3 LOC (100%) 1 file
Other Code
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
  • 13 files match defined criteria (990 LOC, 6.4% vs. main code):
    • 9 *.json files (865 LOC)
    • 2 *.md files (106 LOC)
    • 2 *.txt files (19 LOC)
  • " *.json" is biggest, containing 87.37% of LOC.
  • " *.txt" is smallest, containing 1.92% of LOC.


*.json865 LOC (87%) 9 files
*.md106 LOC (10%) 2 files
*.txt19 LOC (1%) 2 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-06 23:21