facebookresearch / diplomacy_searchbot
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
cc
txt
proto
pt
clang-format
gitattributes
toml
gitmodules
  • 18 extensions are included in analyses: py, cc, h, json, md, txt, sh, proto, gitignore, yml, yaml, pt, clang-format, hpp, gitattributes, toml, gitmodules, html
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (3 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (11 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (1 file).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (47 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) (3 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.

main68128 LOC (73%) 146 files
test24120 LOC (25%) 25 files
generated0 LOC (0%) 0 files
build and deployment29 LOC (<1%) 2 files
other632 LOC (<1%) 8 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
cc
proto
toml
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 146 files match defined criteria (68,128 lines of code, 100.0% vs. main code):
    • 82 *.py files (53,697 lines of code)
    • 1 *.html files (6,758 lines of code)
    • 27 *.cc files (4,486 lines of code)
    • 32 *.h files (2,263 lines of code)
    • 3 *.proto files (921 lines of code)
    • 1 *.toml files (3 lines of code)
  • " *.py" is biggest, containing 78.82% of code.
  • " *.toml" is smallest, containing 0% of code.


*.py53697 LOC (78%) 82 files
*.html6758 LOC (9%) 1 files
*.cc4486 LOC (6%) 27 files
*.h2263 LOC (3%) 32 files
*.proto921 LOC (1%) 3 files
*.toml3 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cc
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
  • 25 files match defined criteria (24,120 lines of code, 35.4% vs. main code):
    • 16 *.cc files (23,693 lines of code)
    • 6 *.py files (389 lines of code)
    • 1 *.sh files (25 lines of code)
    • 2 *.h files (13 lines of code)
  • " *.cc" is biggest, containing 98.23% of code.
  • " *.h" is smallest, containing 0.05% of code.


*.cc23693 LOC (98%) 16 files
*.py389 LOC (1%) 6 files
*.sh25 LOC (<1%) 1 files
*.h13 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitattributes".
  • 2 files match defined criteria (29 lines of code, 0.0% vs. main code). All matches are in *.sh files.


*.sh29 LOC (100%) 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 ".*[.]json".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
  • 8 files match defined criteria (632 lines of code, 0.9% vs. main code):
    • 6 *.md files (545 lines of code)
    • 2 *.json files (87 lines of code)
  • " *.md" is biggest, containing 86.23% of code.
  • " *.json" is smallest, containing 13.77% of code.


*.md545 LOC (86%) 6 files
*.json87 LOC (13%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.cc 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
  • *.proto 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
  • *.toml 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


2022-01-25 20:11