microsoft / kafka
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
properties
cfg
txt
in
xsl
rdf
pub
  • 20 extensions are included in analyses: java, scala, py, html, sh, properties, bat, xml, gitignore, gradle, md, cfg, txt, in, js, xsl, rdf, json, yml, pub
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (58 files).
    • exclude files with path like ".*/cache/.*" (Caches) (5 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (52 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) (1 file).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (1 file).
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.

main143848 LOC (49%) 1474 files
test141488 LOC (48%) 848 files
generated0 LOC (0%) 0 files
build and deployment1652 LOC (<1%) 14 files
other3782 LOC (1%) 69 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xsl
rdf
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1474 files match defined criteria (143,848 lines of code, 100.0% vs. main code):
    • 1,144 *.java files (102,293 lines of code)
    • 320 *.scala files (40,705 lines of code)
    • 3 *.py files (645 lines of code)
    • 1 *.xsl files (153 lines of code)
    • 1 *.rdf files (34 lines of code)
    • 5 *.html files (18 lines of code)
  • " *.java" is biggest, containing 71.11% of code.
  • " *.html" is smallest, containing 0.01% of code.


*.java102293 LOC (71%) 1144 files
*.scala40705 LOC (28%) 320 files
*.py645 LOC (<1%) 3 files
*.xsl153 LOC (<1%) 1 files
*.rdf34 LOC (<1%) 1 files
*.html18 LOC (<1%) 5 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
in
cfg
pub
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 848 files match defined criteria (141,488 lines of code, 98.4% vs. main code):
    • 486 *.java files (88,035 lines of code)
    • 245 *.scala files (45,645 lines of code)
    • 112 *.py files (7,771 lines of code)
    • 1 *.in files (15 lines of code)
    • 1 *.sh files (11 lines of code)
    • 2 *.cfg files (10 lines of code)
    • 1 *.pub files (1 lines of code)
  • " *.java" is biggest, containing 62.22% of code.
  • " *.pub" is smallest, containing 0% of code.


*.java88035 LOC (62%) 486 files
*.scala45645 LOC (32%) 245 files
*.py7771 LOC (5%) 112 files
*.in15 LOC (<1%) 1 files
*.sh11 LOC (<1%) 1 files
*.cfg10 LOC (<1%) 2 files
*.pub1 LOC (<1%) 1 files
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".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/pom[.]xml".
  • 14 files match defined criteria (1,652 lines of code, 1.1% vs. main code):
    • 6 *.gradle files (1,244 lines of code)
    • 8 *.sh files (408 lines of code)
  • " *.gradle" is biggest, containing 75.3% of code.
  • " *.sh" is smallest, containing 24.7% of code.


*.gradle1244 LOC (75%) 6 files
*.sh408 LOC (24%) 8 files
Other Code
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*/checkstyle[.]xml".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 69 files match defined criteria (3,782 lines of code, 2.6% vs. main code):
    • 40 *.properties files (1,245 lines of code)
    • 9 *.xml files (1,017 lines of code)
    • 14 *.java files (768 lines of code)
    • 6 *.md files (752 lines of code)
  • " *.properties" is biggest, containing 32.92% of code.
  • " *.md" is smallest, containing 19.88% of code.


*.properties1245 LOC (32%) 40 files
*.xml1017 LOC (26%) 9 files
*.java768 LOC (20%) 14 files
*.md752 LOC (19%) 6 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.scala files are analyzed with ScalaAnalyzer:
    • 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
  • *.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
  • *.xsl 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
  • *.rdf 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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


2022-01-30 13:31