facebookincubator / SocketRocket
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
gitmodules
  • 16 extensions are included in analyses: h, m, plist, md, json, gitignore, sh, go, py, js, storyboard, txt, yml, html, podspec, gitmodules
  • 3 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (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).
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.

main2844 LOC (75%) 52 files
test394 LOC (10%) 7 files
generated0 LOC (0%) 0 files
build and deployment42 LOC (1%) 3 files
other477 LOC (12%) 10 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 ".*".
  • 52 files match defined criteria (2,844 lines of code, 100.0% vs. main code):
    • 23 *.m files (2,372 lines of code)
    • 25 *.h files (298 lines of code)
    • 1 *.go files (52 lines of code)
    • 1 *.py files (49 lines of code)
    • 1 *.js files (38 lines of code)
    • 1 *.html files (35 lines of code)
  • " *.m" is biggest, containing 83.4% of code.
  • " *.html" is smallest, containing 1.23% of code.


*.m2372 LOC (83%) 23 files
*.h298 LOC (10%) 25 files
*.go52 LOC (1%) 1 files
*.py49 LOC (1%) 1 files
*.js38 LOC (1%) 1 files
*.html35 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/.*".
  • 7 files match defined criteria (394 lines of code, 13.9% vs. main code):
    • 4 *.m files (349 lines of code)
    • 3 *.h files (45 lines of code)
  • " *.m" is biggest, containing 88.58% of code.
  • " *.h" is smallest, containing 11.42% of code.


*.m349 LOC (88%) 4 files
*.h45 LOC (11%) 3 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]podspec".
    • files with paths like ".*/[.]gitmodules".
  • 3 files match defined criteria (42 lines of code, 1.5% vs. main code):
    • 2 *.sh files (23 lines of code)
    • 1 *.podspec files (19 lines of code)
  • " *.sh" is biggest, containing 54.76% of code.
  • " *.podspec" is smallest, containing 45.24% of code.


*.sh23 LOC (54%) 2 files
*.podspec19 LOC (45%) 1 files
Other Code
storyboard
plist
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 ".*/[.]gitignore".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]txt".
  • 10 files match defined criteria (477 lines of code, 16.8% vs. main code):
    • 3 *.md files (167 lines of code)
    • 1 *.storyboard files (126 lines of code)
    • 3 *.json files (94 lines of code)
    • 3 *.plist files (90 lines of code)
  • " *.md" is biggest, containing 35.01% of code.
  • " *.plist" is smallest, containing 18.87% of code.


*.md167 LOC (35%) 3 files
*.storyboard126 LOC (26%) 1 files
*.json94 LOC (19%) 3 files
*.plist90 LOC (18%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.m 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
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
  • *.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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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 01:21