apple / swift-crypto
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
S
txt
patch
in
gitattributes
plist
cmake
  • 17 extensions are included in analyses: c, h, swift, S, json, txt, md, sh, yaml, py, patch, in, gitignore, gitattributes, plist, cmake, inc
  • 6 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 ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (4 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) (15 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.

main304777 LOC (76%) 617 files
test4514 LOC (1%) 30 files
generated0 LOC (0%) 0 files
build and deployment635 LOC (<1%) 9 files
other86168 LOC (21%) 31 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
s
cmake
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 617 files match defined criteria (304,777 lines of code, 100.0% vs. main code):
    • 101 *.s files (168,837 lines of code)
    • 305 *.c files (73,009 lines of code)
    • 127 *.h files (49,819 lines of code)
    • 72 *.swift files (6,410 lines of code)
    • 1 *.inc files (5,715 lines of code)
    • 2 *.py files (770 lines of code)
    • 1 *.cmake files (101 lines of code)
    • 7 *.yaml files (100 lines of code)
    • 1 *.in files (16 lines of code)
  • " *.s" is biggest, containing 55.4% of code.
  • " *.in" is smallest, containing 0.01% of code.


*.s168837 LOC (55%) 101 files
*.c73009 LOC (23%) 305 files
*.h49819 LOC (16%) 127 files
*.swift6410 LOC (2%) 72 files
*.inc5715 LOC (1%) 1 files
*.py770 LOC (<1%) 2 files
*.cmake101 LOC (<1%) 1 files
*.yaml100 LOC (<1%) 7 files
*.in16 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 any line of content like ".*/simpletest/.*".
  • 30 files match defined criteria (4,514 lines of code, 1.5% vs. main code). All matches are in *.swift files.


*.swift4514 LOC (100%) 30 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/docker[-]compose[.]yaml".
    • files with paths like ".*[.]sh".
  • 9 files match defined criteria (635 lines of code, 0.2% vs. main code):
    • 8 *.sh files (606 lines of code)
    • 1 *.yaml files (29 lines of code)
  • " *.sh" is biggest, containing 95.43% of code.
  • " *.yaml" is smallest, containing 4.57% of code.


*.sh606 LOC (95%) 8 files
*.yaml29 LOC (4%) 1 files
Other Code
patch
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 ".*[.]plist".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]patch".
  • 31 files match defined criteria (86,168 lines of code, 28.3% vs. main code):
    • 24 *.json files (85,932 lines of code)
    • 5 *.md files (201 lines of code)
    • 2 *.patch files (35 lines of code)
  • " *.json" is biggest, containing 99.73% of code.
  • " *.patch" is smallest, containing 0.04% of code.


*.json85932 LOC (99%) 24 files
*.md201 LOC (<1%) 5 files
*.patch35 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.s 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
  • *.swift files are analyzed with SwiftAnalyzer:
    • 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
  • *.inc files are analyzed with PhpAnalyzer:
    • 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
  • *.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:59