neo-ai / treelite
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
txt
cmake
gitattributes
proto
gitmodules
  • 23 extensions are included in analyses: py, h, cc, rst, java, txt, md, sh, svg, gitignore, cmake, css, scala, gitattributes, bat, xml, yml, json, html, cpp, c, proto, gitmodules
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (4 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (25 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (0 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 ".*[.]txt" (Text files) (5 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (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.

main9360 LOC (77%) 102 files
test2407 LOC (19%) 16 files
generated52 LOC (<1%) 1 files
build and deployment0 LOC (0%) 0 files
other298 LOC (2%) 7 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cmake
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 102 files match defined criteria (9,360 lines of code, 100.0% vs. main code):
    • 26 *.cc files (4,073 lines of code)
    • 32 *.h files (2,297 lines of code)
    • 28 *.py files (1,690 lines of code)
    • 10 *.java files (518 lines of code)
    • 1 *.yml files (269 lines of code)
    • 2 *.cmake files (244 lines of code)
    • 1 *.cpp files (199 lines of code)
    • 1 *.proto files (64 lines of code)
    • 1 *.scala files (6 lines of code)
  • " *.cc" is biggest, containing 43.51% of code.
  • " *.scala" is smallest, containing 0.06% of code.


*.cc4073 LOC (43%) 26 files
*.h2297 LOC (24%) 32 files
*.py1690 LOC (18%) 28 files
*.java518 LOC (5%) 10 files
*.yml269 LOC (2%) 1 files
*.cmake244 LOC (2%) 2 files
*.cpp199 LOC (2%) 1 files
*.proto64 LOC (<1%) 1 files
*.scala6 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
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 ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 16 files match defined criteria (2,407 lines of code, 25.7% vs. main code):
    • 9 *.py files (2,008 lines of code)
    • 3 *.java files (202 lines of code)
    • 3 *.sh files (123 lines of code)
    • 1 *.c files (74 lines of code)
  • " *.py" is biggest, containing 83.42% of code.
  • " *.c" is smallest, containing 3.07% of code.


*.py2008 LOC (83%) 9 files
*.java202 LOC (8%) 3 files
*.sh123 LOC (5%) 3 files
*.c74 LOC (3%) 1 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 ".*[.]h" AND any line of content like ".* DO NOT EDIT THIS FILE [-] it is machine generated .*".
  • 1 file matches defined criteria (52 lines of code, 0.6% vs. main code). All matches are in *.h files.


*.h52 LOC (100%) 1 files
Other Code
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 ".*/[Ee]xamples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 7 files match defined criteria (298 lines of code, 3.2% vs. main code):
    • 1 *.xml files (171 lines of code)
    • 5 *.md files (117 lines of code)
    • 1 *.py files (10 lines of code)
  • " *.xml" is biggest, containing 57.38% of code.
  • " *.py" is smallest, containing 3.36% of code.


*.xml171 LOC (57%) 1 files
*.md117 LOC (39%) 5 files
*.py10 LOC (3%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.cc files are analyzed with CppAnalyzer:
    • 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
  • *.h files are analyzed with CppAnalyzer:
    • 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
  • *.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
  • *.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)
  • *.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
  • *.cmake 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
  • *.cpp files are analyzed with CppAnalyzer:
    • 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
  • *.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
  • *.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


2022-02-01 03:12