awslabs / aws-mobile-appsync-sdk-ios
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
storyboard
txt
podspec
  • 17 extensions are included in analyses: swift, h, m, plist, md, graphql, json, sh, markdown, storyboard, yml, txt, js, podspec, yaml, c, gitignore
  • 5 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 ".*/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.

main23190 LOC (21%) 176 files
test3199 LOC (2%) 30 files
generated72671 LOC (66%) 390 files
build and deployment69 LOC (<1%) 5 files
other10933 LOC (9%) 71 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 ".*".
  • 176 files match defined criteria (23,190 lines of code, 100.0% vs. main code):
    • 152 *.swift files (21,663 lines of code)
    • 1 *.yaml files (984 lines of code)
    • 18 *.graphql files (515 lines of code)
    • 4 *.h files (15 lines of code)
    • 1 *.js files (13 lines of code)
  • " *.swift" is biggest, containing 93.42% of code.
  • " *.js" is smallest, containing 0.06% of code.


*.swift21663 LOC (93%) 152 files
*.yaml984 LOC (4%) 1 files
*.graphql515 LOC (2%) 18 files
*.h15 LOC (<1%) 4 files
*.js13 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 ".*UnitTests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 30 files match defined criteria (3,199 lines of code, 13.8% vs. main code). All matches are in *.swift files.


*.swift3199 LOC (100%) 30 files
Generated Code
Automatically generated files, not manually changed after generation.
plist
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/Pods/.*".
  • 390 files match defined criteria (72,671 lines of code, 313.4% vs. main code):
    • 117 *.m files (45,205 lines of code)
    • 72 *.swift files (8,728 lines of code)
    • 154 *.h files (6,418 lines of code)
    • 1 *.c files (4,494 lines of code)
    • 24 *.plist files (3,587 lines of code)
    • 7 *.markdown files (2,513 lines of code)
    • 10 *.md files (985 lines of code)
    • 5 *.sh files (741 lines of code)
  • " *.m" is biggest, containing 62.21% of code.
  • " *.sh" is smallest, containing 1.02% of code.


*.m45205 LOC (62%) 117 files
*.swift8728 LOC (12%) 72 files
*.h6418 LOC (8%) 154 files
*.c4494 LOC (6%) 1 files
*.plist3587 LOC (4%) 24 files
*.markdown2513 LOC (3%) 7 files
*.md985 LOC (1%) 10 files
*.sh741 LOC (1%) 5 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 ".*[.]sh".
    • files with paths like ".*[.]podspec".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 5 files match defined criteria (69 lines of code, 0.3% vs. main code):
    • 4 *.sh files (50 lines of code)
    • 1 *.podspec files (19 lines of code)
  • " *.sh" is biggest, containing 72.46% of code.
  • " *.podspec" is smallest, containing 27.54% of code.


*.sh50 LOC (72%) 4 files
*.podspec19 LOC (27%) 1 files
Other Code
plist
storyboard
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]markdown".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*/[.]gitignore".
  • 71 files match defined criteria (10,933 lines of code, 47.1% vs. main code):
    • 37 *.plist files (3,884 lines of code)
    • 9 *.json files (2,616 lines of code)
    • 7 *.markdown files (2,513 lines of code)
    • 14 *.md files (1,684 lines of code)
    • 4 *.storyboard files (236 lines of code)
  • " *.plist" is biggest, containing 35.53% of code.
  • " *.storyboard" is smallest, containing 2.16% of code.


*.plist3884 LOC (35%) 37 files
*.json2616 LOC (23%) 9 files
*.markdown2513 LOC (22%) 7 files
*.md1684 LOC (15%) 14 files
*.storyboard236 LOC (2%) 4 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.graphql 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
  • *.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
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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-31 18:20