|
| 1 | +# plceye |
| 2 | + |
| 3 | +A static analyzer and code smell detector for Rockwell Automation L5X files (Studio 5000 Logix Designer). |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Unused Tags** - Detect tags that are defined but never referenced |
| 8 | +- **Undefined Tags** - Find tags referenced in code but not declared |
| 9 | +- **Empty Routines** - Identify routines with no logic |
| 10 | +- **Configurable** - Customize detection via `plceye.toml` |
| 11 | + |
| 12 | +## Installation |
| 13 | + |
| 14 | +```bash |
| 15 | +cargo install plceye |
| 16 | +``` |
| 17 | + |
| 18 | +## Usage |
| 19 | + |
| 20 | +```bash |
| 21 | +# Analyze a single file |
| 22 | +plceye project.L5X |
| 23 | + |
| 24 | +# Analyze multiple files |
| 25 | +plceye *.L5X |
| 26 | + |
| 27 | +# Use custom configuration |
| 28 | +plceye --config plceye.toml project.L5X |
| 29 | + |
| 30 | +# Generate default configuration |
| 31 | +plceye init |
| 32 | +``` |
| 33 | + |
| 34 | +## Configuration |
| 35 | + |
| 36 | +Create a `plceye.toml` file to customize detection: |
| 37 | + |
| 38 | +```toml |
| 39 | +[unused_tags] |
| 40 | +enabled = true |
| 41 | +severity = "info" |
| 42 | +# Ignore tags matching these patterns |
| 43 | +ignore = ["zz*", "Spare_*", "_*"] |
| 44 | + |
| 45 | +[undefined_tags] |
| 46 | +enabled = true |
| 47 | +severity = "warning" |
| 48 | +# Known valid references (aliases, I/O modules) |
| 49 | +ignore = ["Local:*", "S:*"] |
| 50 | + |
| 51 | +[empty_routines] |
| 52 | +enabled = true |
| 53 | +severity = "info" |
| 54 | +ignore = ["*_Template"] |
| 55 | +``` |
| 56 | + |
| 57 | +## Output |
| 58 | + |
| 59 | +``` |
| 60 | +=== project.L5X === |
| 61 | +[info] unused-tag: Controller - Tag 'Spare_01' is defined but never used |
| 62 | +[warning] undefined-tag: Program:Main - Tag 'Unknown' is referenced but not defined |
| 63 | +
|
| 64 | +Found 2 issue(s) in 1 file(s). |
| 65 | +``` |
| 66 | + |
| 67 | +## Detected Issues |
| 68 | + |
| 69 | +| Issue | Description | Default Severity | |
| 70 | +|-------|-------------|------------------| |
| 71 | +| `unused-tag` | Tag defined but never referenced | info | |
| 72 | +| `undefined-tag` | Tag referenced but not defined | warning | |
| 73 | +| `empty-routine` | Routine with no executable logic | info | |
| 74 | + |
| 75 | +## Disclaimer |
| 76 | + |
| 77 | +This is an independent open-source project and is not affiliated with, endorsed by, or associated with Rockwell Automation, Inc. |
| 78 | + |
| 79 | +"Rockwell Automation", "Allen-Bradley", "Studio 5000", and "Logix Designer" are trademarks of Rockwell Automation, Inc. |
| 80 | + |
| 81 | +## License |
| 82 | + |
| 83 | +MIT License - see [LICENSE](LICENSE) for details. |
0 commit comments