Skip to content

Commit a0b7aef

Browse files
committed
feat(iec61131): add static analysis module with CFG, complexity, and nesting depth calculations
- Introduced `analysis::cfg` for Control Flow Graph construction and analysis. - Added functions for cyclomatic complexity calculations and nesting depth analysis. - Enhanced documentation with examples for new analysis features. BREAKING CHANGE: Updated `plceye` to migrate from `iecst` to `iec61131` v0.7.0 for ST parsing and analysis, improving error reporting and language support. fix(plceye): adapt analysis modules to use new AST structure from `iec61131` - Updated references in `l5x_analysis`, `st_parsing`, and `complexity` modules to use the new `iec61131` analysis functions. - Maintained backward compatibility for existing rules and detectors. chore(iec61131): update version to 0.7.0 and enhance crate description - Updated `Cargo.toml` to reflect new version and added static analysis capabilities. - Improved changelog with detailed descriptions of new features and changes.
1 parent 74f1a66 commit a0b7aef

File tree

16 files changed

+971
-66
lines changed

16 files changed

+971
-66
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

iec61131/CHANGELOG.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
# Changelog
22

3+
## 0.7.0 (2025-12-11)
4+
5+
### Added
6+
- **Static analysis module** - Complete analysis capabilities for PLC code
7+
- `analysis::cfg` - Control Flow Graph (CFG) construction and analysis
8+
- `CfgBuilder` - build CFG from AST statements
9+
- `Cfg` - graph structure with cyclomatic complexity calculation
10+
- `cyclomatic_complexity()` - calculate code complexity
11+
- `cyclomatic_complexity_decisions()` - alternative calculation using decision points
12+
- `to_dot()` - export to Graphviz format for visualization
13+
- `analysis::nesting` - Nesting depth analysis
14+
- `max_nesting_depth()` - calculate maximum control structure nesting
15+
- `count_expression_decisions()` - count AND/OR decisions in expressions
16+
17+
### Changed
18+
- Updated exports to include `Variable`, `Argument`, and `StatementList`
19+
- Enhanced documentation with analysis examples
20+
321
## 0.6.1 (2025-12-11)
4-
- parser analysis added
522
- parser security added
623

724
## 0.6.0 (2025-12-11)

iec61131/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[package]
22
name = "iec61131"
3-
version = "0.6.1"
3+
version = "0.7.0"
44
edition = "2021"
5-
description = "Complete IEC 61131-3 parser for all 5 PLC programming languages"
5+
description = "Complete IEC 61131-3 parser for all 5 PLC programming languages with static analysis"
66
license = "MIT"
77
repository = "https://github.com/radevgit/plc"
88
homepage = "https://github.com/radevgit/plc"

0 commit comments

Comments
 (0)