Moved the index into language specific doc

This commit is contained in:
oowekyala
2017-07-30 23:31:39 +02:00
parent fe1d7748ad
commit e662aef673
2 changed files with 33 additions and 5 deletions

View File

@ -99,6 +99,9 @@ entries:
- title: JSP Support
url: /pmd_languages_jsp.html
output: web, pdf
- title: Index of Java code metrics
url: /pmd_java_metrics_index.html
output: web, pdf
- title: Developer Documentation
output: web, pdf
folderitems:
@ -138,9 +141,6 @@ entries:
- title: Using code metrics in custom rules
url: /pmd_devdocs_metrics_howto.html
output: web, pdf
- title: Index of code metrics
url: /pmd_devdocs_metrics_index.html
output: web, pdf
- title: Making Rulesets
url: /pmd_devdocs_making_rulesets.html
output: web, pdf

View File

@ -4,8 +4,8 @@ tags: [customizing]
summary: "Index of the code metrics available out of the box to Java rule developers."
last_updated: July 20, 2017
sidebar: pmd_sidebar
permalink: pmd_devdocs_metrics_index.html
folder: pmd/devdocs
permalink: pmd_java_metrics_index.html
folder: pmd/languages
toc:
minimumHeaders: 8
---
@ -39,6 +39,34 @@ conditional expression (`?:`) \[[Sonarqube](#Sonarqube)\]. Notice switch cases c
* +1 for every boolean operator (`&&`, `||`) in the guard condition of a control flow statement. That's because
Java has short-circuit evaluation semantics for boolean operators, which makes every boolean operator kind of a
control flow statement in itself.
### Code examples
```java
class Foo {
void baseCyclo() { // Cyclo = 1
highCyclo();
}
void highCyclo() { // Cyclo =
int x = 0, y = 2;
boolean a = false, b = true;
if (a && (y == 1 ? b : true)) {
if (y == x) {
while (true) {
if (x++ < 20) {
break;
}
}
} else if (y == t && !d) {
x = a ? y : x;
} else {
x = 2;
}
}
}
}
```
### Versions