-
-
Notifications
You must be signed in to change notification settings - Fork 27.3k
#2151 Feature/mvi pattern #2177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The build is failing. Please investigate @JanFidor |
@iluwatar It seems an independent module is causing issues (page-object). My build is failing even on the master branch after syncing the fork. The first error is caused by missing test dependencies, after adding them this line throws an error |
The error from the CI build is |
@iluwatar my bad for misinterpreting logs and sorry for the delay, university gave me plenty of work this week, but I'll get right on it now. |
@iluwatar fixed the violations, was a little closer to 60 after I run checkstyle locally, but it checks out now |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorModel.java
Outdated
Show resolved
Hide resolved
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java
Outdated
Show resolved
Hide resolved
model-view-intent/src/main/java/com/iluwatar/model/view/intent/actions/CalculatorAction.java
Show resolved
Hide resolved
Hi, @iluwatar sorry for the long break, but the past couple of weeks have been pretty crazy on my end, but I'll be getting on it now |
# Conflicts: # pom.xml
… had to change it back
Kudos, SonarCloud Quality Gate passed! |
* and displays its updated {@link CalculatorModel}. | ||
*/ | ||
@Slf4j | ||
@Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ObjectToString: CalculatorViewModel is final and does not override Object.toString, so converting it to a string will print its identity (e.g. CalculatorViewModel@4488aabb
) instead of useful information.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
/** | ||
* SetVariable {@link CalculatorAction}. | ||
*/ | ||
@Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 7 similar findings have been found in this PR
Var: Non-constant variable missing @var annotation
@Data | |
@Var @Data |
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
model-view-intent/src/main/java/com/iluwatar/model/view/intent/App.java | 59 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorViewModel.java | 27 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorModel.java | 9 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorViewModel.java | 70 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java | 19 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/App.java | 54 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java | 71 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
/** | ||
* SetVariable {@link CalculatorAction}. | ||
*/ | ||
@Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 3 similar findings have been found in this PR
Varifier: Consider using var
here to avoid boilerplate.
@Data | |
var |
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java | 19 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorViewModel.java | 46 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorModel.java | 9 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
/** | ||
* Current state of calculator. | ||
*/ | ||
@Data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 26 similar findings have been found in this PR
UnnecessarilyFullyQualified: This fully qualified name is unambiguous to the compiler if imported.
@Data | |
Override |
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java | 18 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java | 19 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorModel.java | 15 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/actions/SetVariableCalculatorAction.java | 9 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/actions/SetVariableCalculatorAction.java | 9 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/actions/SetVariableCalculatorAction.java | 9 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java | 19 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java | 25 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorModel.java | 9 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorModel.java | 21 |
Showing 10 of 26 findings. Visit the Lift Web Console to see all.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
* | ||
* @param variable -> value of new calculator model variable. | ||
*/ | ||
private void setVariable(final Double variable) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💬 3 similar findings have been found in this PR
UnnecessaryFinal: Since Java 8, it's been unnecessary to make local variables and parameters final
for use in lambdas or anonymous classes. Marking them as final
is weakly discouraged, as it adds a fair amount of noise for minimal benefit.
private void setVariable(final Double variable) { | |
private void setVariable( Double variable) { |
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
model-view-intent/src/main/java/com/iluwatar/model/view/intent/App.java | 54 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorViewModel.java | 27 |
model-view-intent/src/main/java/com/iluwatar/model/view/intent/CalculatorView.java | 71 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
🛠 Lift Auto-fixSome of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.1 # Download the patch
curl https://lift.sonatype.com/api/patch/github.com/iluwatar/java-design-patterns/2177.diff -o lift-autofixes.diff
# Apply the patch with git
git apply lift-autofixes.diff
# Review the changes
git diff Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command: curl https://lift.sonatype.com/api/patch/github.com/iluwatar/java-design-patterns/2177.diff | git apply Once you're satisfied commit and push your changes in your project. Footnotes |
@iluwatar I made the changes you suggested, I'm not certain what to do about sonatype-lift errors, especially when it comes to Lombok decorators and deleting the final keyword which would cause chackstyle errors (just like in the FSM PR) |
Lift doesn't seem to handle Lombok annotations too well, so I think we can disregard them. |
Looks good! Thank you for contributing this new pattern 🎉 @all-contributors please add @JanFidor for code |
I couldn't determine any contributions to add, did you specify any contributions? @JanFidor already contributed before to code |
Add an MVI design pattern (includes pattern itself, tests, README.md and class diagram)