facebookresearch / faiss
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
cu
cuh
txt
dockerignore
in
clang-format
cmake
  • 19 extensions are included in analyses: cpp, h, py, cu, cuh, md, txt, sh, yml, yaml, bat, c, bash, dockerignore, json, in, gitignore, clang-format, cmake
  • 4 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 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) (10 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.

main72716 LOC (83%) 447 files
test12397 LOC (14%) 67 files
generated0 LOC (0%) 0 files
build and deployment94 LOC (<1%) 8 files
other1979 LOC (2%) 21 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cuh
cu
cmake
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 447 files match defined criteria (72,716 lines of code, 100.0% vs. main code):
    • 118 *.cpp files (33,438 lines of code)
    • 60 *.cuh files (11,061 lines of code)
    • 140 *.h files (10,533 lines of code)
    • 66 *.cu files (9,835 lines of code)
    • 54 *.py files (6,592 lines of code)
    • 2 *.bash files (603 lines of code)
    • 1 *.cmake files (315 lines of code)
    • 2 *.c files (177 lines of code)
    • 3 *.yaml files (156 lines of code)
    • 1 *.in files (6 lines of code)
  • " *.cpp" is biggest, containing 45.98% of code.
  • " *.in" is smallest, containing 0.01% of code.


*.cpp33438 LOC (45%) 118 files
*.cuh11061 LOC (15%) 60 files
*.h10533 LOC (14%) 140 files
*.cu9835 LOC (13%) 66 files
*.py6592 LOC (9%) 54 files
*.bash603 LOC (<1%) 2 files
*.cmake315 LOC (<1%) 1 files
*.c177 LOC (<1%) 2 files
*.yaml156 LOC (<1%) 3 files
*.in6 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cu
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]est/.*".
  • 67 files match defined criteria (12,397 lines of code, 17.0% vs. main code):
    • 37 *.py files (7,962 lines of code)
    • 25 *.cpp files (4,003 lines of code)
    • 2 *.cu files (334 lines of code)
    • 1 *.h files (92 lines of code)
    • 2 *.sh files (6 lines of code)
  • " *.py" is biggest, containing 64.23% of code.
  • " *.sh" is smallest, containing 0.05% of code.


*.py7962 LOC (64%) 37 files
*.cpp4003 LOC (32%) 25 files
*.cu334 LOC (2%) 2 files
*.h92 LOC (<1%) 1 files
*.sh6 LOC (<1%) 2 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 ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 8 files match defined criteria (94 lines of code, 0.1% vs. main code):
    • 6 *.sh files (55 lines of code)
    • 2 *.bat files (39 lines of code)
  • " *.sh" is biggest, containing 58.51% of code.
  • " *.bat" is smallest, containing 41.49% of code.


*.sh55 LOC (58%) 6 files
*.bat39 LOC (41%) 2 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/INSTALL[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Dd]emos?/.*".
  • 21 files match defined criteria (1,979 lines of code, 2.7% vs. main code):
    • 12 *.md files (1,116 lines of code)
    • 6 *.cpp files (671 lines of code)
    • 3 *.py files (192 lines of code)
  • " *.md" is biggest, containing 56.39% of code.
  • " *.py" is smallest, containing 9.7% of code.


*.md1116 LOC (56%) 12 files
*.cpp671 LOC (33%) 6 files
*.py192 LOC (9%) 3 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.cuh 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
  • *.cu 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
  • *.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
  • *.bash files are analyzed with ShellAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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-25 19:30