Skip to content

Conversation

Pankraz76
Copy link
Contributor

@Pankraz76 Pankraz76 commented Oct 16, 2025

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the Core IT successfully.

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

enabler for:

related to:

Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

Can you explain how you found those issues, as some of them are just plain wrong. It also contains lots of unrelated changes.

@Pankraz76 Pankraz76 changed the title [prone] Add DirectReturn [prone] Add UnusedVariable Oct 16, 2025
@Pankraz76
Copy link
Contributor Author

Can you explain how you found those issues, as some of them are just plain wrong. It also contains lots of unrelated changes.

updated to something simple like unused variable. Direct return is something to consider later on as in this case its quite "complex".

@Pankraz76 Pankraz76 requested a review from gnodet October 16, 2025 14:28
@Pankraz76 Pankraz76 marked this pull request as ready for review October 16, 2025 14:28
Copy link
Contributor Author

@Pankraz76 Pankraz76 left a comment

Choose a reason for hiding this comment

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

2 ct.

src = Interpolator.chain(userProperties::get, systemProperties::get);
}
return new DefSettingsTransformer(value -> value != null ? interpolator.interpolate(value, src) : null)
private Settings interpolate(Settings settings, SettingsBuilderRequest request) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Once again, those are not unused variables. These are intermediary results.
Your refactoring hinders readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ppl wondering just like the SCA why its unused or ignored. Having it named accordingly or removed seems to be the best practise in order to turn the questions into answers, as history is mystery.

Copy link
Contributor

Choose a reason for hiding this comment

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

ppl wondering just like the SCA why its unused or ignored. Having it named accordingly or removed seems to be the best practise in order to turn the questions into answers, as history is mystery.

best practice is to understand what you are refactoring instead of blindly trusting tools/AI

Copy link
Contributor Author

@Pankraz76 Pankraz76 Oct 17, 2025

Choose a reason for hiding this comment

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

One could argue that "understanding" is a complex goal for this codebase. The presence of incorrect, ignored, and unused segments suggests that the original intent has become obscured over time. It's likely the logic was once valid, but that context has been lost.

The system continues to operate, but its current behavior appears disconnected from its actual purpose, seemingly functioning through emergent coincidence rather than by explicit design (no unused stuff dangling around).

In these situations, static code analysis becomes a valuable tool for reconstructing the rationale behind the code. As team members move on, institutional knowledge fades, and manual auditing does not scale effectively.

From my perspective, comprehending the full scope is challenging. For instance, the purpose of an unused field isn't clear, requiring me to hypothesize about its original function.

Ideally, code should narrate its purpose like a coherent story, with each line building upon the last. Gaps in this narrative—such as unused components or logical inconsistencies—highlight areas where the underlying purpose has been lost. While there may be valid, albeit hidden, reasons for these anomalies, the process of understanding involves methodically converting these open questions into resolved answers to piece together the complete picture.

@Pankraz76 Pankraz76 force-pushed the prone branch 2 times, most recently from dfa71eb to 9b9f1c6 Compare October 16, 2025 16:20
@Pankraz76 Pankraz76 requested a review from gnodet October 16, 2025 16:40
@Pankraz76 Pankraz76 force-pushed the prone branch 2 times, most recently from 9c45a03 to 80c922b Compare October 16, 2025 17:40
Copy link
Contributor Author

@Pankraz76 Pankraz76 left a comment

Choose a reason for hiding this comment

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

public by default.

@Pankraz76 Pankraz76 marked this pull request as draft October 16, 2025 17:45
Copy link
Contributor

@gnodet gnodet left a comment

Choose a reason for hiding this comment

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

This PR has, once again, derailed.
It contains changes which have nothing in common.
Please split PR:

  • one for the """ string blocks, but maybe look at the whole codebase where it makes sense
  • one for XmlNode.toString refactoring
  • one for removing unused variables (but without any other refactoring)

@Pankraz76 Pankraz76 requested a review from gnodet October 17, 2025 09:29
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.

3 participants