Crate plceye

Crate plceye 

Source
Expand description

plceye - PLC Code Rule Detector

Open source static analyzer for PLC files that detects code rules and potential issues in PLC programs.

§Supported Formats

  • L5X - Rockwell Automation Studio 5000
  • PLCopen XML - IEC 61131-3 standard exchange format

§Supported Rules (Open Source)

  • S0001: unused_tags - Tags defined but never used
  • S0002: undefined_tags - Tags referenced but not defined
  • S0003: empty_routines - Routines with no logic
  • S0004: unused_aois - AOIs defined but never called
  • S0005: unused_datatypes - User-defined types never used
  • M0001: cyclomatic_complexity - ST routines with high complexity
  • M0003: deep_nesting - Control structures nested too deeply

§CLI Usage

# Analyze a file
plceye project.L5X

# With custom config
plceye --config plceye.toml project.L5X

Re-exports§

pub use analysis::ProjectAnalysis;
pub use analysis::ParseStats;
pub use analysis::analyze_controller;
pub use analysis::PlcopenAnalysis;
pub use analysis::PlcopenStats;
pub use analysis::analyze_plcopen_project;
pub use l5x;
pub use plcopen;
pub use iec61131;

Modules§

analysis
Project analysis module.

Structs§

ComplexityConfig
Configuration for cyclomatic complexity detection.
EmptyRoutinesConfig
Configuration for empty routine detection.
GeneralConfig
General configuration settings.
LoadedProject
A loaded project with its format-specific data.
NestingConfig
Configuration for deep nesting detection.
Report
Report containing all detected rules.
Rule
A single detected code rule.
RuleConfig
Main configuration for the rule detector.
RuleDetector
Main rule detector that runs all enabled detectors.
UndefinedTagsConfig
Configuration for undefined tag detection.
UnusedAoisConfig
Configuration for unused AOI detection.
UnusedDataTypesConfig
Configuration for unused DataType detection.
UnusedTagsConfig
Configuration for unused tag detection.

Enums§

ConfigErrorKind
Kinds of configuration errors.
Error
Error types for the rule detector.
FileFormat
Detected file format.
L5xParseErrorKind
Kinds of L5X parse errors.
RuleKind
Kind of code rule detected.
Severity
Severity level of a detected rule.

Type Aliases§

Result
Result type alias for rule operations.