2025 init

This commit is contained in:
Romain Lefeuvre
2025-11-18 14:41:54 +01:00
commit 7b185c9c0c
19 changed files with 417 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
# Extending PMD
Use XPath to define a new rule for PMD to prevent complex code. The rule should detect the use of three or more nested `if` statements in Java programs so it can detect patterns like the following:
```Java
if (...) {
...
if (...) {
...
if (...) {
....
}
}
}
```
Notice that the nested `if`s may not be direct children of the outer `if`s. They may be written, for example, inside a `for` loop or any other statement.
Write below the XML definition of your rule.
You can find more information on extending PMD in the following link: https://pmd.github.io/latest/pmd_userdocs_extending_writing_rules_intro.html, as well as help for using `pmd-designer` [here](https://github.com/selabs-ur1/VV-ISTIC-TP2/blob/master/exercises/designer-help.md).
Use your rule with different projects and describe you findings below. See the [instructions](../sujet.md) for suggestions on the projects to use.
## Answer