awslabs / smithy-swift
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
plist
txt
podspec
properties
  • 14 extensions are included in analyses: kt, swift, md, kts, plist, yml, json, txt, podspec, properties, gitignore, h, bat, sh
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (9 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (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).
    • exclude files with path like ".*[.]txt" (Text files) (1 file).
    • 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.

main13539 LOC (48%) 297 files
test13143 LOC (47%) 89 files
generated0 LOC (0%) 0 files
build and deployment126 LOC (<1%) 4 files
other966 LOC (3%) 12 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 297 files match defined criteria (13,539 lines of code, 100.0% vs. main code):
    • 137 *.kt files (9,121 lines of code)
    • 153 *.swift files (4,216 lines of code)
    • 5 *.kts files (187 lines of code)
    • 1 *.yml files (12 lines of code)
    • 1 *.h files (3 lines of code)
  • " *.kt" is biggest, containing 67.37% of code.
  • " *.h" is smallest, containing 0.02% of code.


*.kt9121 LOC (67%) 137 files
*.swift4216 LOC (31%) 153 files
*.kts187 LOC (1%) 5 files
*.yml12 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.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 89 files match defined criteria (13,143 lines of code, 97.1% vs. main code):
    • 67 *.kt files (11,625 lines of code)
    • 22 *.swift files (1,518 lines of code)
  • " *.kt" is biggest, containing 88.45% of code.
  • " *.swift" is smallest, containing 11.55% of code.


*.kt11625 LOC (88%) 67 files
*.swift1518 LOC (11%) 22 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
podspec
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]podspec".
  • 4 files match defined criteria (126 lines of code, 0.9% vs. main code):
    • 1 *.bat files (78 lines of code)
    • 2 *.podspec files (29 lines of code)
    • 1 *.sh files (19 lines of code)
  • " *.bat" is biggest, containing 61.9% of code.
  • " *.sh" is smallest, containing 15.08% of code.


*.bat78 LOC (61%) 1 files
*.podspec29 LOC (23%) 2 files
*.sh19 LOC (15%) 1 files
Other Code
plist
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
  • 12 files match defined criteria (966 lines of code, 7.1% vs. main code):
    • 6 *.md files (820 lines of code)
    • 3 *.plist files (74 lines of code)
    • 2 *.json files (52 lines of code)
    • 1 *.properties files (20 lines of code)
  • " *.md" is biggest, containing 84.89% of code.
  • " *.properties" is smallest, containing 2.07% of code.


*.md820 LOC (84%) 6 files
*.plist74 LOC (7%) 3 files
*.json52 LOC (5%) 2 files
*.properties20 LOC (2%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.kt files are analyzed with KotlinAnalyzer:
    • 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 (based on imports and package statements)
  • *.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
  • *.kts files are analyzed with KotlinAnalyzer:
    • 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 (based on imports and package statements)
  • *.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
  • *.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-01-31 19:22