pub enum RuleKind {
Show 31 variants
UnusedTag,
UndefinedTag,
EmptyBlock,
UnusedAoi,
UnusedDataType,
CyclomaticComplexity,
DeepNesting,
FloatEquality,
TimeEquality,
DivisionByZero,
MagicNumber,
TimerNoReset,
RecursiveCall,
LoopVarModified,
TooManyParameters,
ExcessiveGlobals,
ContinueUsed,
ExitUsed,
IfWithoutElse,
CaseWithoutElse,
ReturnInMiddle,
NameTooShort,
NameTooLong,
AoiNoDescription,
TagNoDescription,
RoutineNoDescription,
ProgramNoDescription,
TaskWatchdogDisabled,
ExcessiveTaskRate,
AliasChain,
LargeArray,
}Expand description
Kind of code rule detected.
This enum contains all rule types. The open-source plceye detects the first 5 rules.
Additional rules are detected by plceye-pro (commercial license).
Variants§
UnusedTag
S0001: Tag is defined but never used
UndefinedTag
S0002: Tag is used but never defined (might be external/aliased)
EmptyBlock
S0003: Empty routine or POU
UnusedAoi
S0004: AOI is defined but never called
UnusedDataType
S0005: DataType is defined but never used
CyclomaticComplexity
M0001: Cyclomatic complexity too high
DeepNesting
M0003: Deep nesting (> 4 levels)
FloatEquality
C0010: Floating-point comparison with = or <>
TimeEquality
C0011: TIME comparison with = or <>
DivisionByZero
C0014: Possible division by zero
MagicNumber
C0015: Magic number (hardcoded literal that should be a constant)
TimerNoReset
C0016: Timer/counter without reset path
RecursiveCall
C0031: POU calls itself recursively
LoopVarModified
C0032: FOR loop variable modified inside loop
TooManyParameters
C0050: POU has too many parameters (>7)
ExcessiveGlobals
C0060: Too many global variables
ContinueUsed
S0020: CONTINUE statement used
ExitUsed
S0021: EXIT statement used
IfWithoutElse
S0022: IF without ELSE clause
CaseWithoutElse
S0023: CASE without ELSE clause
ReturnInMiddle
S0025: RETURN not at end of POU
NameTooShort
N0006: Name length < 3 characters
NameTooLong
N0007: Name length > 30 characters
AoiNoDescription
X0001: AOI without description
TagNoDescription
X0002: Tag without description
RoutineNoDescription
X0003: Routine without description
ProgramNoDescription
X0004: Program without description
TaskWatchdogDisabled
X0006: Task watchdog disabled
ExcessiveTaskRate
X0007: Excessive task rate (<1ms)
AliasChain
X0009: Alias chain (alias pointing to alias)
LargeArray
X0010: Large array (>10000 elements)
Implementations§
Trait Implementations§
impl Eq for RuleKind
impl StructuralPartialEq for RuleKind
Auto Trait Implementations§
impl Freeze for RuleKind
impl RefUnwindSafe for RuleKind
impl Send for RuleKind
impl Sync for RuleKind
impl Unpin for RuleKind
impl UnwindSafe for RuleKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.