Skip to main content

Project Discovery

Bob the Fixer automatically analyzes your project structure to detect languages, frameworks, and recommend optimal configurations.

How It Works

When you run a scan or setup, Bob the Fixer's Project Discovery service:

  1. Scans the project directory for configuration files
  2. Identifies languages, frameworks, and build tools
  3. Recommends a quality gate template
  4. Generates a unique project key

Supported Languages

LanguageDetection MethodIndicators
JavaScriptpackage.jsonDependencies, scripts
TypeScripttsconfig.jsonCompiler configuration
Javapom.xml, build.gradleMaven/Gradle projects
Pythonrequirements.txt, pyproject.toml, setup.py, PipfilePackage files
Gogo.modGo modules
RustCargo.tomlCargo package
C#*.csproj.NET project files

Framework Detection

JavaScript/TypeScript

FrameworkDetectionIndicator
Reactpackage.jsonreact dependency
Vuepackage.jsonvue dependency
Angularpackage.json@angular/core dependency
Next.jspackage.jsonnext dependency
Expresspackage.jsonexpress dependency

Java

FrameworkDetectionIndicator
Spring Bootpom.xmlspring-boot in dependencies

Python

Detected via package manager files (requirements.txt, pyproject.toml, etc.)

Build Tool Detection

LanguageBuild Tools Detected
JavaScript/TypeScriptwebpack, vite, npm scripts
JavaMaven, Gradle
Pythonpip, Poetry, Pipenv
GoGo Modules
RustCargo
C#dotnet

Using Project Discovery

Via AI Assistant

Analyze this project and tell me what you detect

Uses the sonar_project_discovery tool.

Discovery Options

OptionTypeDescription
pathstringDirectory to analyze (defaults to current)
deepbooleanPerform deep analysis including dependencies

Example Output

PROJECT DISCOVERY RESULTS

Project: my-awesome-app
Path: /Users/dev/my-awesome-app

LANGUAGES DETECTED:
- Typescript
- Javascript

Framework: react
Build Tool: vite
Package Manager: npm

RECOMMENDED QUALITY GATE: balanced
QUALITY CONDITIONS:
- new_bugs: LT 1
- new_vulnerabilities: LT 1
- new_blocker_violations: LT 1
- new_critical_violations: LT 1
- new_coverage: LT 60
- new_duplicated_lines_density: GT 5

RECOMMENDED PROJECT KEY: my-awesome-app-a1b2c3d4

NEXT STEPS:
1. Run sonar_auto_setup to configure SonarQube
2. Use sonar_scan_project to analyze code quality

Quality Gate Recommendations

Based on project type, Bob the Fixer recommends appropriate quality gates:

Project TypeRecommended TemplateReason
New projectsStrictStart with high standards
Production appsStrictEnsure quality
Libraries/SDKsBalancedAllow some flexibility
Legacy codePermissiveGradual improvement
PrototypesPermissiveFast iteration

Project Key Generation

Bob the Fixer generates unique project keys using:

{project-name}-{path-hash}

Where:

  • project-name: Lowercase, alphanumeric version of directory name
  • path-hash: 8-character SHA-256 hash of full path

Example: my-app-a1b2c3d4

This ensures:

  • Unique keys across different directories
  • Consistent keys for the same project
  • Human-readable identification

Multi-Language Projects

For projects with multiple languages, all detected languages are reported:

LANGUAGES DETECTED:
- Typescript
- Javascript
- Python

The primary language (first detected) influences:

  • Quality gate selection
  • Default exclusion patterns
  • Scanner configuration

Monorepo Support

For monorepos, you can run discovery on specific subdirectories:

Analyze the project at packages/frontend

Or use the path option:

{
"path": "./packages/frontend",
"deep": true
}

Deep Analysis

With deep: true, additional analysis includes:

  • Dependency tree inspection
  • Test framework detection
  • CI/CD configuration detection
  • Code coverage tool detection

Troubleshooting

"No language detected"

If Bob the Fixer reports generic as the language:

  1. Ensure configuration files exist (package.json, pom.xml, etc.)
  2. Check file permissions
  3. Run with deep: true for more thorough detection

Wrong framework detected

The detection is based on dependencies. If multiple frameworks are present, the first match wins. You can override in sonar-project.properties:

sonar.language=typescript

Project key conflicts

If you have multiple projects with the same name in different locations, they'll have different keys due to the path hash.

Next Steps