facebookexperimental / rust-shed
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
cmake
snap
txt
  • 13 extensions are included in analyses: rs, toml, py, cmake, md, sh, snap, gitignore, txt, c, h, json, yml
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (1 file).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (3 files).
    • exclude files with path like ".*/deps/.*" (Dependencies) (1 file).
    • 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).
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.

main29054 LOC (92%) 256 files
test1866 LOC (5%) 42 files
generated0 LOC (0%) 0 files
build and deployment189 LOC (<1%) 3 files
other308 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.
cmake
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 256 files match defined criteria (29,054 lines of code, 100.0% vs. main code):
    • 147 *.rs files (19,137 lines of code)
    • 28 *.py files (6,607 lines of code)
    • 20 *.cmake files (2,111 lines of code)
    • 59 *.toml files (1,122 lines of code)
    • 1 *.c files (74 lines of code)
    • 1 *.h files (3 lines of code)
  • " *.rs" is biggest, containing 65.87% of code.
  • " *.h" is smallest, containing 0.01% of code.


*.rs19137 LOC (65%) 147 files
*.py6607 LOC (22%) 28 files
*.cmake2111 LOC (7%) 20 files
*.toml1122 LOC (3%) 59 files
*.c74 LOC (<1%) 1 files
*.h3 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
snap
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*__tests__.*".
    • files with paths like ".*[.]snap".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/tests_.*".
    • files with paths like ".*/[Ss]pecs/.*".
  • 42 files match defined criteria (1,866 lines of code, 6.4% vs. main code):
    • 20 *.rs files (1,338 lines of code)
    • 19 *.py files (502 lines of code)
    • 1 *.toml files (16 lines of code)
    • 2 *.snap files (10 lines of code)
  • " *.rs" is biggest, containing 71.7% of code.
  • " *.snap" is smallest, containing 0.54% of code.


*.rs1338 LOC (71%) 20 files
*.py502 LOC (26%) 19 files
*.toml16 LOC (<1%) 1 files
*.snap10 LOC (<1%) 2 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".
  • 3 files match defined criteria (189 lines of code, 0.7% vs. main code). All matches are in *.sh files.


*.sh189 LOC (100%) 3 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
  • 8 files match defined criteria (308 lines of code, 1.1% vs. main code):
    • 6 *.md files (202 lines of code)
    • 1 *.json files (72 lines of code)
    • 1 *.rs files (34 lines of code)
  • " *.md" is biggest, containing 65.58% of code.
  • " *.rs" is smallest, containing 11.04% of code.


*.md202 LOC (65%) 6 files
*.json72 LOC (23%) 1 files
*.rs34 LOC (11%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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
  • *.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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.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


2022-04-15 06:01