# mcbottm/mcbotweb architecture

> Architecture diagram of the GitHub repository mcbottm/mcbotweb, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mcbottm/mcbotweb
- Repository: https://github.com/mcbottm/mcbotweb

## Overview

MCBOTWEB is an offline static security and syntax scanner for web-project source trees. A user selects files or a directory and scan modes through the CLI; the scanner collects relevant files, dispatches per-file vulnerability and lint checks, optionally runs project-wide contextual checks, then scores findings for a verdict and report. The graph also shows rule loading and language detection as shared internal layers. The scanner’s documented orchestration supports the contextual branches; unsampled implementation details are not inferred beyond those documented calls.

Main entry points: [`mcbotweb/core/scanner.py`](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/scanner.py) (Scan orchestrator), [`mcbotweb/core/analyzer.py`](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/analyzer.py) (File analyzer), [`mcbotweb/static/_scan_common.py`](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/_scan_common.py) (Shared rule matching), [`mcbotweb/core/rule_loader.py`](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/rule_loader.py) (Rule loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_cli["CLI<br/>[main.py]"]
end

subgraph group_orchestration["Scan orchestration"]
  node_scanner["Scan orchestrator<br/>[scanner.py]"]
  node_extractor["File extraction<br/>[extractor.py]"]
  node_language["Language detection<br/>[language_detect.py]"]
  node_analyzer["File analyzer<br/>[analyzer.py]"]
end

subgraph group_static["Static analysis"]
  node_php_scan["PHP vuln scan<br/>[php_scan.py]"]
  node_js_scan["JavaScript vuln scan<br/>[js_scan.py]"]
  node_html_scan["HTML vuln scan<br/>[html_scan.py]"]
  node_py_scan["Python vuln scan<br/>[py_scan.py]"]
  node_scan_common["Shared rule matching<br/>[_scan_common.py]"]
  node_lint_engines["Language lint checks"]
end

subgraph group_contextual["Project context"]
  node_framework_detect["Framework detection"]
  node_framework_rules["Framework rules<br/>[framework_rules.py]"]
  node_secrets["Secret scan<br/>[secret_scanner.py]"]
  node_env_config["Env and config scan"]
  node_dependencies["Dependency check"]
  node_project_structure["Project structure check"]
end

subgraph group_results["Findings and rules"]
  node_scoring["Finding scoring<br/>[scoring.py]"]
  node_rule_loader["Rule loader<br/>[rule_loader.py]"]
  node_vuln_rules["Vulnerability rules"]
  node_dependency_rules["Vulnerable package list"]
  node_scoring_rules["Scoring rules<br/>[scoring_rules.yaml]"]
  node_report["Report output<br/>[report.py]"]
end

node_user(("User"))

node_user -->|"selects targets"| node_cli
node_cli -->|"runs scan"| node_scanner
node_scanner -->|"collects files"| node_extractor
node_extractor -->|"detects language"| node_language
node_scanner -->|"analyzes files"| node_analyzer
node_analyzer -->|"detects language"| node_language
node_analyzer -->|"dispatches"| node_php_scan
node_analyzer -->|"dispatches"| node_js_scan
node_analyzer -->|"dispatches"| node_html_scan
node_analyzer -->|"dispatches"| node_py_scan
node_analyzer -->|"dispatches"| node_lint_engines
node_php_scan -->|"uses matching"| node_scan_common
node_js_scan -->|"uses matching"| node_scan_common
node_html_scan -->|"uses matching"| node_scan_common
node_py_scan -->|"uses matching"| node_scan_common
node_scan_common -->|"loads rules"| node_rule_loader
node_rule_loader -->|"loads"| node_vuln_rules
node_scanner -->|"detects frameworks"| node_framework_detect
node_scanner -->|"runs checks"| node_framework_rules
node_scanner -->|"scans secrets"| node_secrets
node_scanner -->|"scans config"| node_env_config
node_scanner -->|"checks dependencies"| node_dependencies
node_dependencies -->|"matches package list"| node_dependency_rules
node_scanner -->|"checks structure"| node_project_structure
node_scanner -->|"scores findings"| node_scoring
node_scoring -->|"loads scoring rules"| node_rule_loader
node_rule_loader -->|"loads"| node_scoring_rules
node_cli -->|"prints or saves"| node_report

click node_cli "https://github.com/mcbottm/mcbotweb/blob/main/cli/main.py"
click node_scanner "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/scanner.py"
click node_extractor "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/extractor.py"
click node_language "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/utils/language_detect.py"
click node_analyzer "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/analyzer.py"
click node_php_scan "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/php_scan.py"
click node_js_scan "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/js_scan.py"
click node_html_scan "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/html_scan.py"
click node_py_scan "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/py_scan.py"
click node_scan_common "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/_scan_common.py"
click node_lint_engines "https://github.com/mcbottm/mcbotweb/tree/main/mcbotweb/static"
click node_framework_detect "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/framework_detector.py"
click node_framework_rules "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/framework_rules.py"
click node_secrets "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/secret_scanner.py"
click node_env_config "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/env_config_scanner.py"
click node_dependencies "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/dependency_checker.py"
click node_project_structure "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/project_structure_scanner.py"
click node_scoring "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/scoring.py"
click node_rule_loader "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/rule_loader.py"
click node_vuln_rules "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/rules/web_vuln_rules.json"
click node_dependency_rules "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/rules/known_vulnerable_packages.json"
click node_scoring_rules "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/rules/scoring_rules.yaml"
click node_report "https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/report.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_user toneBlue
class node_scanner,node_extractor,node_language,node_analyzer toneAmber
class node_php_scan,node_js_scan,node_html_scan,node_py_scan,node_scan_common,node_lint_engines toneMint
class node_framework_detect,node_framework_rules,node_secrets,node_env_config,node_dependencies,node_project_structure toneRose
class node_scoring,node_rule_loader,node_vuln_rules,node_dependency_rules,node_scoring_rules,node_report toneIndigo
```

## Components

### User entry

- [CLI](https://github.com/mcbottm/mcbotweb/blob/main/cli/main.py): `cli/main.py`

### Scan orchestration

- [Scan orchestrator](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/scanner.py): `mcbotweb/core/scanner.py`
- [File extraction](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/extractor.py): `mcbotweb/core/extractor.py`
- [Language detection](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/utils/language_detect.py): `mcbotweb/utils/language_detect.py`
- [File analyzer](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/analyzer.py): `mcbotweb/core/analyzer.py`

### Static analysis

- [PHP vuln scan](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/php_scan.py): `mcbotweb/static/php_scan.py`
- [JavaScript vuln scan](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/js_scan.py): `mcbotweb/static/js_scan.py`
- [HTML vuln scan](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/html_scan.py): `mcbotweb/static/html_scan.py`
- [Python vuln scan](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/py_scan.py): `mcbotweb/static/py_scan.py`
- [Shared rule matching](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/static/_scan_common.py): `mcbotweb/static/_scan_common.py`
- [Language lint checks](https://github.com/mcbottm/mcbotweb/tree/main/mcbotweb/static): `mcbotweb/static`

### Project context

- [Framework detection](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/framework_detector.py): `mcbotweb/contextual/framework_detector.py`
- [Framework rules](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/framework_rules.py): `mcbotweb/contextual/framework_rules.py`
- [Secret scan](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/secret_scanner.py): `mcbotweb/contextual/secret_scanner.py`
- [Env and config scan](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/env_config_scanner.py): `mcbotweb/contextual/env_config_scanner.py`
- [Dependency check](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/dependency_checker.py): `mcbotweb/contextual/dependency_checker.py`
- [Project structure check](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/contextual/project_structure_scanner.py): `mcbotweb/contextual/project_structure_scanner.py`

### Findings and rules

- [Finding scoring](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/scoring.py): `mcbotweb/core/scoring.py`
- [Rule loader](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/rule_loader.py): `mcbotweb/core/rule_loader.py`
- [Vulnerability rules](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/rules/web_vuln_rules.json): `mcbotweb/rules/web_vuln_rules.json`
- [Vulnerable package list](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/rules/known_vulnerable_packages.json): `mcbotweb/rules/known_vulnerable_packages.json`
- [Scoring rules](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/rules/scoring_rules.yaml): `mcbotweb/rules/scoring_rules.yaml`
- [Report output](https://github.com/mcbottm/mcbotweb/blob/main/mcbotweb/core/report.py): `mcbotweb/core/report.py`

### Other components

- **User**

## Connections

- User → CLI: selects targets (evidence: `README.md`)
- CLI → Scan orchestrator: runs scan (evidence: `cli/main.py`)
- Scan orchestrator → File extraction: collects files (evidence: `mcbotweb/core/scanner.py`)
- File extraction → Language detection: detects language (evidence: `mcbotweb/core/extractor.py`)
- Scan orchestrator → File analyzer: analyzes files (evidence: `mcbotweb/core/scanner.py`)
- File analyzer → Language detection: detects language (evidence: `mcbotweb/core/analyzer.py`)
- File analyzer → PHP vuln scan: dispatches (evidence: `mcbotweb/core/analyzer.py`)
- File analyzer → JavaScript vuln scan: dispatches (evidence: `mcbotweb/core/analyzer.py`)
- File analyzer → HTML vuln scan: dispatches (evidence: `mcbotweb/core/analyzer.py`)
- File analyzer → Python vuln scan: dispatches (evidence: `mcbotweb/core/analyzer.py`)
- File analyzer → Language lint checks: dispatches (evidence: `mcbotweb/core/analyzer.py`)
- PHP vuln scan → Shared rule matching: uses matching (evidence: `mcbotweb/static/php_scan.py`)
- JavaScript vuln scan → Shared rule matching: uses matching (evidence: `mcbotweb/static/js_scan.py`)
- HTML vuln scan → Shared rule matching: uses matching (evidence: `mcbotweb/static/html_scan.py`)
- Python vuln scan → Shared rule matching: uses matching (evidence: `mcbotweb/static/py_scan.py`)
- Shared rule matching → Rule loader: loads rules (evidence: `mcbotweb/static/_scan_common.py`)
- Rule loader → Vulnerability rules: loads (evidence: `mcbotweb/core/rule_loader.py`)
- Scan orchestrator → Framework detection: detects frameworks (evidence: `mcbotweb/core/scanner.py`)
- Scan orchestrator → Framework rules: runs checks (evidence: `mcbotweb/core/scanner.py`)
- Scan orchestrator → Secret scan: scans secrets (evidence: `mcbotweb/core/scanner.py`)
- Scan orchestrator → Env and config scan: scans config (evidence: `mcbotweb/core/scanner.py`)
- Scan orchestrator → Dependency check: checks dependencies (evidence: `mcbotweb/core/scanner.py`)
- Dependency check → Vulnerable package list: matches package list (evidence: `mcbotweb/contextual/dependency_checker.py`)
- Scan orchestrator → Project structure check: checks structure (evidence: `mcbotweb/core/scanner.py`)
- Scan orchestrator → Finding scoring: scores findings (evidence: `mcbotweb/core/scanner.py`)
- Finding scoring → Rule loader: loads scoring rules (evidence: `mcbotweb/core/scoring.py`)
- Rule loader → Scoring rules: loads (evidence: `mcbotweb/core/rule_loader.py`)
- CLI → Report output: prints or saves (evidence: `cli/main.py`)
