Skip to content

Fix documentation issues - #230

Merged
lesquoyb merged 6 commits into
2024-06from
Fix-documentation-issues
Jun 27, 2024
Merged

Fix documentation issues#230
lesquoyb merged 6 commits into
2024-06from
Fix-documentation-issues

Conversation

@benoitgaudou

Copy link
Copy Markdown
Contributor

Fixes attempt for issues #222, #219, #220, #214 from gama-platform.github.io repository

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: FAILED

  • Declining Code Health: 1 findings(s) 🚩
  • Improving Code Health: 6 findings(s) ✅
  • Affected Hotspots: 1 files(s) 🔥

View detailed results in CodeScene

Comment thread gama.documentation/src/gama/documentation/util/UnifyDoc.java
Comment thread gama.processor/src/gama/processor/doc/DocProcessor.java
Comment thread gama.processor/src/gama/processor/doc/DocProcessor.java
Comment thread gama.processor/src/gama/processor/doc/DocProcessor.java
Comment thread gama.processor/src/gama/processor/doc/DocProcessor.java
Comment thread gama.processor/src/gama/processor/doc/DocProcessor.java

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Health Quality Gates: FAILED

  • Declining Code Health: 2 findings(s) 🚩
  • Improving Code Health: 9 findings(s) ✅
  • Affected Hotspots: 1 files(s) 🔥

View detailed results in CodeScene

Comment thread gama.processor/src/gama/processor/doc/DocProcessor.java
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Getting better: Overall Code Complexity
The mean cyclomatic complexity decreases from 9.22 to 7.77, threshold = 4

Comment on lines -777 to -778
}
return operators;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Getting better: Bumpy Road Ahead
processDocXMLOperators decreases from 5 to 2 logical blocks with deeply nested code, threshold is one single block per function

Comment on lines -777 to -778
}
return operators;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Getting better: Complex Method
processDocXMLOperators decreases in cyclomatic complexity from 24 to 12, threshold = 9

Comment on lines +753 to +754
private void addConcepts(org.w3c.dom.Element operator, ExecutableElement e) {
org.w3c.dom.Element conceptsElt;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ New issue: Code Duplication
The module contains 5 functions with similar structure: addCategories,addConcepts,processDocXMLStatementsInsideKind,processDocXMLStatementsInsideSymbol and 1 more functions

Suppress

Comment on lines -777 to -778
}
return operators;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No longer an issue: Deep, Nested Complexity
processDocXMLOperators is no longer above the threshold for nested complexity depth

@lesquoyb

Copy link
Copy Markdown
Contributor

I think that's good enough for the codescene report, the only thing we could do to help with code "duplication" is to refactor completely the module to have getConcepts, getCategories and getDocElt to merge into one method. I don't think it's worth the hassle and it would probably lead to a monster of a method anyway

@lesquoyb

Copy link
Copy Markdown
Contributor

I think that's good enough for the codescene report, the only thing we could do to help with code "duplication" is to refactor completely the module to have getConcepts, getCategories and getDocElt to merge into one method. I don't think it's worth the hassle and it would probably lead to a monster of a method anyway.
There's just one thing I want you to double check for me: I commented out those lines:

			if (e.getAnnotation(doc.class) != null && !"".equals(e.getAnnotation(doc.class).deprecated())) {
				// We just omit it
			} else {

because that test was already done a few lines above, so my guess was that it was some forgotten code with no practical impact, but maybe I overlooked it and it makes sense ?

@benoitgaudou

Copy link
Copy Markdown
Contributor Author

Indeed you can remove one if :-)

@lesquoyb
lesquoyb merged commit 9e9f852 into 2024-06 Jun 27, 2024
@lesquoyb
lesquoyb deleted the Fix-documentation-issues branch June 27, 2024 08:47
RoiArthurB added a commit that referenced this pull request Jul 23, 2026
)

Operators in ImageOperators and Displays declare no explicit category, so they
fell back to their Java class name and appeared under the non-uniform titles
"ImageOperators" / "Displays" instead of proper "... operators" titles.

Add canonical IMAGE ("Image operators") and DISPLAY ("Display operators")
categories and map those two classes to them, so their titles are uniform with
the rest of the operator categories.

Fixes gama-platform.github.io#230
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants