microsoft / react-native-code-push
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
npmignore
plist
properties
watchmanconfig
props
csproj
gitattributes
vcxproj
filters
pro
xaml
targets
editorconfig
shproj
podspec
storyboard
txt
  • 33 extensions are included in analyses: js, h, m, java, cs, md, json, cpp, c, gitignore, gradle, xml, npmignore, plist, properties, watchmanconfig, props, csproj, ts, gitattributes, bat, vcxproj, filters, pro, xaml, targets, bzl, yml, editorconfig, shproj, podspec, storyboard, txt
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (28 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (2 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (2 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (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 ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (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.

main28859 LOC (57%) 189 files
test2140 LOC (4%) 41 files
generated8048 LOC (15%) 1 files
build and deployment426 LOC (<1%) 8 files
other11149 LOC (22%) 70 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
filters
shproj
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 189 files match defined criteria (28,859 lines of code, 100.0% vs. main code):
    • 14 *.c files (11,064 lines of code)
    • 33 *.m files (5,713 lines of code)
    • 57 *.h files (3,627 lines of code)
    • 22 *.java files (2,389 lines of code)
    • 27 *.js files (2,185 lines of code)
    • 21 *.cs files (1,937 lines of code)
    • 10 *.cpp files (1,629 lines of code)
    • 1 *.vcxproj files (198 lines of code)
    • 1 *.filters files (91 lines of code)
    • 1 *.shproj files (13 lines of code)
    • 2 *.props files (13 lines of code)
  • " *.c" is biggest, containing 38.34% of code.
  • " *.props" is smallest, containing 0.05% of code.


*.c11064 LOC (38%) 14 files
*.m5713 LOC (19%) 33 files
*.h3627 LOC (12%) 57 files
*.java2389 LOC (8%) 22 files
*.js2185 LOC (7%) 27 files
*.cs1937 LOC (6%) 21 files
*.cpp1629 LOC (5%) 10 files
*.vcxproj198 LOC (<1%) 1 files
*.filters91 LOC (<1%) 1 files
*.shproj13 LOC (<1%) 1 files
*.props13 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*__tests__.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 41 files match defined criteria (2,140 lines of code, 7.4% vs. main code):
    • 1 *.ts files (1,201 lines of code)
    • 34 *.js files (542 lines of code)
    • 3 *.cs files (182 lines of code)
    • 1 *.csproj files (130 lines of code)
    • 1 *.java files (60 lines of code)
    • 1 *.m files (25 lines of code)
  • " *.ts" is biggest, containing 56.12% of code.
  • " *.m" is smallest, containing 1.17% of code.


*.ts1201 LOC (56%) 1 files
*.js542 LOC (25%) 34 files
*.cs182 LOC (8%) 3 files
*.csproj130 LOC (6%) 1 files
*.java60 LOC (2%) 1 files
*.m25 LOC (1%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/package[-]lock[.]json".
  • 1 file matches defined criteria (8,048 lines of code, 27.9% vs. main code). All matches are in *.json files.


*.json8048 LOC (100%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
podspec
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 ".*[.]podspec".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*[.]csproj".
  • 8 files match defined criteria (426 lines of code, 1.5% vs. main code):
    • 2 *.csproj files (217 lines of code)
    • 4 *.gradle files (122 lines of code)
    • 1 *.bat files (66 lines of code)
    • 1 *.podspec files (21 lines of code)
  • " *.csproj" is biggest, containing 50.94% of code.
  • " *.podspec" is smallest, containing 4.93% of code.


*.csproj217 LOC (50%) 2 files
*.gradle122 LOC (28%) 4 files
*.bat66 LOC (15%) 1 files
*.podspec21 LOC (4%) 1 files
Other Code
vcxproj
plist
filters
storyboard
properties
xaml
props
targets
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 ".*/[.]npmignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 70 files match defined criteria (11,149 lines of code, 38.6% vs. main code):
    • 11 *.json files (8,333 lines of code)
    • 11 *.js files (849 lines of code)
    • 8 *.md files (836 lines of code)
    • 1 *.vcxproj files (201 lines of code)
    • 5 *.cpp files (140 lines of code)
    • 3 *.gradle files (125 lines of code)
    • 3 *.m files (111 lines of code)
    • 4 *.plist files (97 lines of code)
    • 6 *.h files (75 lines of code)
    • 2 *.java files (72 lines of code)
    • 1 *.bat files (68 lines of code)
    • 1 *.filters files (60 lines of code)
    • 6 *.xml files (48 lines of code)
    • 1 *.storyboard files (46 lines of code)
    • 2 *.properties files (37 lines of code)
    • 2 *.xaml files (22 lines of code)
    • 1 *.bzl files (17 lines of code)
    • 1 *.props files (7 lines of code)
    • 1 *.targets files (5 lines of code)
  • " *.json" is biggest, containing 74.74% of code.
  • " *.targets" is smallest, containing 0.04% of code.


*.json8333 LOC (74%) 11 files
*.js849 LOC (7%) 11 files
*.md836 LOC (7%) 8 files
*.vcxproj201 LOC (1%) 1 files
*.cpp140 LOC (1%) 5 files
*.gradle125 LOC (1%) 3 files
*.m111 LOC (<1%) 3 files
*.plist97 LOC (<1%) 4 files
*.h75 LOC (<1%) 6 files
*.java72 LOC (<1%) 2 files
*.bat68 LOC (<1%) 1 files
*.filters60 LOC (<1%) 1 files
*.xml48 LOC (<1%) 6 files
*.storyboard46 LOC (<1%) 1 files
*.properties37 LOC (<1%) 2 files
*.xaml22 LOC (<1%) 2 files
*.bzl17 LOC (<1%) 1 files
*.props7 LOC (<1%) 1 files
*.targets5 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 (based on namespace heuristics)
  • *.cpp 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
  • *.vcxproj files are analyzed with XmlAnalyzer:
    • 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
  • *.filters files are analyzed with XmlAnalyzer:
    • 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
  • *.shproj files are analyzed with XmlAnalyzer:
    • 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
  • *.props files are analyzed with XmlAnalyzer:
    • 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


2022-01-30 10:16