static-bug-detector — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited static-bug-detector (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Perform static analysis on source code to identify potential functional bugs. Detect common bug patterns, analyze control flow and data flow, and report suspicious locations with explanations, severity levels, and confidence assessments.
Analyze the code structure and semantics:
Scan for common bug patterns:
Assess the impact of each bug:
High Severity:
Medium Severity:
Low Severity:
Determine confidence in the bug report:
High Confidence (90-100%):
Medium Confidence (60-89%):
Low Confidence (30-59%):
Factors:
Produce structured bug report:
For detailed patterns and examples, see detection_patterns.md.
| Bug Category | Common Patterns | Severity | Detection Difficulty |
|---|---|---|---|
| Null Dereference | No null check, null after use | High | Easy |
| Incorrect Conditions | = vs ==, always true/false | High-Medium | Easy |
| Unreachable Code | After return, dead branch | Low | Easy |
| Inconsistent State | Partial update, no validation | High-Medium | Medium |
| Logic Errors | Off-by-one, wrong precedence | High-Medium | Medium |
| Resource Issues | Leaks, double close | Medium | Medium |
| Type Issues | Mismatch, implicit coercion | Medium-Low | Easy |
Input Code (Java):
public String getUserName(int userId) {
User user = userRepository.findById(userId);
return user.getName();
}Analysis Output:
## Bug: Potential null dereference
**Location:** line 3
**Severity:** High
**Confidence:** High (95%)
### Description
Variable 'user' may be null but is dereferenced without null check.
### Why This Is a Bug
Method 'findById' may return null if user not found. Calling 'getName()'
on null will throw NullPointerException.
### Potential Impact
- Runtime NullPointerException
- Application crash
- Poor user experience
### Recommendation
Add null check before dereferencing:
public String getUserName(int userId) { User user = userRepository.findById(userId); if (user == null) { return null; // or throw exception } return user.getName(); }
Or use Optional:public Optional<String> getUserName(int userId) { return Optional.ofNullable(userRepository.findById(userId)) .map(User::getName); }
Input Code (C):
int status = getStatus();
if (status = SUCCESS) {
printf("Operation successful\n");
}Analysis Output:
## Bug: Assignment in condition
**Location:** line 2
**Severity:** High
**Confidence:** High (98%)
### Description
Using assignment operator '=' instead of comparison operator '==' in condition.
### Why This Is a Bug
Expression 'status = SUCCESS' assigns SUCCESS to status and evaluates to
SUCCESS value. This is almost always a typo for 'status == SUCCESS'.
### Potential Impact
- Condition always evaluates to true (if SUCCESS is non-zero)
- Original status value lost
- Logic error in program flow
### Recommendation
Change to comparison operator:
if (status == SUCCESS) { printf("Operation successful\n"); }
Most compilers warn about this. Enable warnings: -Wall -WextraInput Code (Python):
def process_array(arr):
for i in range(len(arr) + 1):
print(arr[i])Analysis Output:
## Bug: Off-by-one error (array index out of bounds)
**Location:** line 2-3
**Severity:** High
**Confidence:** High (100%)
### Description
Loop iterates one past the end of array, causing IndexError.
### Why This Is a Bug
range(len(arr) + 1) produces indices 0 to len(arr) inclusive. Array
indices are 0 to len(arr)-1, so arr[len(arr)] is out of bounds.
### Potential Impact
- IndexError exception
- Program crash
- Incorrect behavior
### Recommendation
Remove the +1:
def process_array(arr): for i in range(len(arr)): print(arr[i])
Or use idiomatic iteration:def process_array(arr): for item in arr: print(item)
Input Code (Python):
def read_config(path):
f = open(path)
config = json.load(f)
return configAnalysis Output:
## Bug: Resource leak
**Location:** line 2
**Severity:** Medium
**Confidence:** High (90%)
### Description
File opened but never closed, causing resource leak.
### Why This Is a Bug
File handle opened on line 2 is never closed. If exception occurs during
json.load or in normal execution, file remains open.
### Potential Impact
- File descriptor leak
- Resource exhaustion with many calls
- File locking issues on Windows
### Recommendation
Use context manager to ensure cleanup:
def read_config(path): with open(path) as f: config = json.load(f) return config
Or ensure close in finally:def read_config(path): f = open(path) try: config = json.load(f) return config finally: f.close()
Input Code (Java):
public class BankAccount {
private double balance;
public void transfer(BankAccount target, double amount) {
this.balance -= amount;
// Missing: target.balance += amount
}
}Analysis Output:
## Bug: Incomplete state update
**Location:** line 5
**Severity:** High
**Confidence:** Medium (75%)
### Description
Transfer method deducts from source but doesn't add to target, leaving
system in inconsistent state.
### Why This Is a Bug
Money is removed from source account but never added to target account.
This violates the invariant that total money in system is constant.
### Potential Impact
- Money disappears from system
- Data corruption
- Accounting errors
- Loss of funds
### Recommendation
Complete the transfer operation:
public void transfer(BankAccount target, double amount) { if (this.balance < amount) { throw new InsufficientFundsException(); } this.balance -= amount; target.balance += amount; }
Consider making atomic with synchronization or transactions.Input Code (JavaScript):
function calculate(x) {
if (x < 0) {
return -x;
}
return x;
console.log("Calculated"); // Unreachable
}Analysis Output:
## Bug: Unreachable code
**Location:** line 6
**Severity:** Low
**Confidence:** High (100%)
### Description
Statement is unreachable because function returns unconditionally on line 5.
### Why This Is a Bug
All code paths return before line 6. The console.log statement can never
execute, indicating dead code or logic error.
### Potential Impact
- Dead code clutters codebase
- May indicate incomplete refactoring
- Confusing for maintainers
### Recommendation
Remove unreachable code:
function calculate(x) { if (x < 0) { return -x; } return x; }
Or if logging was intended, move before return:function calculate(x) { let result = x < 0 ? -x : x; console.log("Calculated"); return result; }
# Static Analysis Report
**Files Analyzed:** X
**Bugs Found:** Y
**High Severity:** A
**Medium Severity:** B
**Low Severity:** C
## Summary by Category
- Null Dereference: X bugs
- Incorrect Conditions: Y bugs
- Unreachable Code: Z bugs
- Inconsistent State: A bugs
- Logic Errors: B bugs
- Resource Issues: C bugs
- Type Issues: D bugs## Bug #N: [Bug Type]
**Location:** [File]:[Line] or [Line Range]
**Severity:** [High/Medium/Low]
**Confidence:** [High/Medium/Low] ([Percentage]%)
### Description
[What the bug is]
### Why This Is a Bug
[Explanation of the problem]
### Potential Impact
[What could go wrong]
### Recommendation
[How to fix it]
### Code Context[Code snippet with line numbers]
### Example Fix[Corrected code]
Report High Confidence when:
Report Medium Confidence when:
Report Low Confidence when:
✅ Null dereferences ✅ Incorrect conditions ✅ Unreachable code ✅ Logic errors ✅ Resource leaks ✅ Type mismatches ✅ Off-by-one errors ✅ Inconsistent state updates
❌ Concurrency bugs (race conditions, deadlocks) ❌ Performance issues (without profiling) ❌ Security vulnerabilities (requires specialized analysis) ❌ Design flaws (architectural issues) ❌ Business logic errors (requires domain knowledge) ❌ Integration issues (requires runtime context)
Some reported bugs may be intentional:
Always verify bugs in context before fixing.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.