Skip to content

CodeInspector tool ignores severityExclusions parameter when blank #113

@rhennigan

Description

@rhennigan

Note the list of severity exclusions claimed in the output:

In[1]:= $DefaultMCPTools["CodeInspector"][<|"code" -> "f[x_] := 1 + 1", "severityExclusions" -> ""|>]

Out[1]=
"# Code Inspection Results

No issues found matching the specified criteria.

**Settings:**
- Confidence Level: 0.75
- Severity Exclusions: Formatting, Remark, Scoping
- Tag Exclusions: (none)"

This UnusedParameter hint should have been found in the above example:

In[2]:= $DefaultMCPTools["CodeInspector"][<|"code" -> "f[x_] := 1 + 1", "severityExclusions" -> "Formatting,Remark"|>]

Out[2]=
"# Code Inspection Results

## Summary

| Severity | Count |
|----------|-------|
| Scoping | 1 |
| **Total** | **1** |

## Issues

### Issue 1: UnusedParameter (Scoping, 95%)

**Location:** Line 1, Column 3 - Line 1, Column 4

**Description:** Unused ``SetDelayed`` parameter: ``x``.

**Code:**
```wl
   1 | f[x_] := 1 + 1
```

**Suggested Fix:**
- Remove parameter `x`
---

**Tip:** To suppress specific issues, wrap code with:
```wl
(* :!CodeAnalysis::BeginBlock:: *)
(* :!CodeAnalysis::Disable::{Tag}:: *)
...
(* :!CodeAnalysis::EndBlock:: *)
```
"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions