apple / coremltools
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
proto
txt
cmake
in
m4
xproj
plist
storyboard
gitmodules
cfg
ini
vim
el
nuspec
podspec
  • 45 extensions are included in analyses: py, h, cc, proto, java, cs, cpp, rst, php, m, hpp, txt, sh, md, js, xml, c, json, rb, gitignore, cmake, in, m4, yml, xproj, plist, mm, go, xib, bat, yaml, storyboard, gitmodules, cfg, ini, svg, css, bzl, vim, swift, el, gemspec, mustache, nuspec, podspec
  • 11 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (23 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (1734 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (0 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (58 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (0 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (0 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 ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (4 files).
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.

main72684 LOC (23%) 447 files
test66113 LOC (21%) 171 files
generated164678 LOC (54%) 85 files
build and deployment513 LOC (<1%) 7 files
other624 LOC (<1%) 8 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
cmake
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 447 files match defined criteria (72,684 lines of code, 100.0% vs. main code):
    • 265 *.py files (46,288 lines of code)
    • 62 *.cpp files (12,974 lines of code)
    • 32 *.proto files (8,040 lines of code)
    • 46 *.hpp files (2,679 lines of code)
    • 35 *.h files (1,948 lines of code)
    • 3 *.mm files (598 lines of code)
    • 1 *.cmake files (106 lines of code)
    • 2 *.yaml files (50 lines of code)
    • 1 *.in files (1 lines of code)
  • " *.py" is biggest, containing 63.68% of code.
  • " *.in" is smallest, containing 0% of code.


*.py46288 LOC (63%) 265 files
*.cpp12974 LOC (17%) 62 files
*.proto8040 LOC (11%) 32 files
*.hpp2679 LOC (3%) 46 files
*.h1948 LOC (2%) 35 files
*.mm598 LOC (<1%) 3 files
*.cmake106 LOC (<1%) 1 files
*.yaml50 LOC (<1%) 2 files
*.in1 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 ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 171 files match defined criteria (66,113 lines of code, 91.0% vs. main code):
    • 137 *.py files (55,842 lines of code)
    • 28 *.cpp files (9,818 lines of code)
    • 6 *.hpp files (453 lines of code)
  • " *.py" is biggest, containing 84.46% of code.
  • " *.hpp" is smallest, containing 0.69% of code.


*.py55842 LOC (84%) 137 files
*.cpp9818 LOC (14%) 28 files
*.hpp453 LOC (<1%) 6 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 ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
  • 85 files match defined criteria (164,678 lines of code, 226.6% vs. main code):
    • 32 *.cc files (102,747 lines of code)
    • 32 *.h files (59,525 lines of code)
    • 21 *.py files (2,406 lines of code)
  • " *.cc" is biggest, containing 62.39% of code.
  • " *.py" is smallest, containing 1.46% of code.


*.cc102747 LOC (62%) 32 files
*.h59525 LOC (36%) 32 files
*.py2406 LOC (1%) 21 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 ".*/[.]gitmodules".
    • files with paths like ".*[.]podspec".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*/pom[.]xml".
    • files with paths like ".*/package[.]json".
  • 7 files match defined criteria (513 lines of code, 0.7% vs. main code). All matches are in *.sh files.


*.sh513 LOC (100%) 7 files
Other Code
plist
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]vim".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 8 files match defined criteria (624 lines of code, 0.9% vs. main code):
    • 5 *.md files (574 lines of code)
    • 1 *.plist files (26 lines of code)
    • 1 *.ini files (16 lines of code)
    • 1 *.rst files (8 lines of code)
  • " *.md" is biggest, containing 91.99% of code.
  • " *.rst" is smallest, containing 1.28% of code.


*.md574 LOC (91%) 5 files
*.plist26 LOC (4%) 1 files
*.ini16 LOC (2%) 1 files
*.rst8 LOC (1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.hpp 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
  • *.mm 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
  • *.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
  • *.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
  • *.in 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


2022-01-30 21:38