Skip to content
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

KOGITO-7977 Sonarcloud - (Java) Lambdas should be replaced with method references (61) #2501

Closed
wants to merge 3 commits into from

Conversation

kbowers-ibm
Copy link
Contributor

https://issues.redhat.com/browse/KOGITO-7977

Goal here is to reduce the number of code smells in Kogito-runtimes.

Addressed in this PR is the code smell, "(Java) Lambdas should be replaced with method references (61)"
https://sonarcloud.io/project/issues?resolved=false&rules=java%3AS1612&types=CODE_SMELL&id=org.kie.kogito%3Akogito-runtimes

I have remedied this by replacing the suggested lambdas with method/constructor references as per Sonarcloud's recommendation.

How to replicate CI configuration locally?

Build Chain tool does "simple" maven build(s), the builds are just Maven commands, but because the repositories relates and depends on each other and any change in API or class method could affect several of those repositories there is a need to use build-chain tool to handle cross repository builds and be sure that we always use latest version of the code for each repository.

build-chain tool is a build tool which can be used on command line locally or in Github Actions workflow(s), in case you need to change multiple repositories and send multiple dependent pull requests related with a change you can easily reproduce the same build by executing it on Github hosted environment or locally in your development environment. See local execution details to get more information about it.

How to retest this PR or trigger a specific build:

Jenkins retest this

@kie-ci3
Copy link
Contributor

kie-ci3 commented Sep 26, 2022

(tests) - kogito-examples job #1130 was: FAILURE
Possible explanation: Pipeline failure or project build failure

Please look here: https://eng-jenkins-csb-business-automation.apps.ocp-c1.prod.psi.redhat.com/job/KIE/job/kogito/job/main/job/pullrequest/job/kogito-runtimes.tests.downstream.kogito-examples/1130/display/redirect
See console log:

Console Logs [2022-09-26T07:42:04.335Z] 8.3M /home/jenkins/.cache
[2022-09-26T07:42:04.335Z] du: cannot access ‘/home/jenkins/workspace/KIE/optaplanner/main/pullrequest/optaplanner.tests.downstream.optaweb-vehicle-routing_ws-cleanup_1664178120425/bc/kiegroup_optaweb_vehicle_routing/optaweb-vehicle-routing/optaweb-vehicle-routing-frontend/node_modules/eslint-config-airbnb-base/node_modules/es-abstract/2017/DeletePropertyOrThrow.js’: No such file or directory
[2022-09-26T07:42:04.335Z] du: cannot access ‘/home/jenkins/workspace/KIE/optaplanner/main/pullrequest/optaplanner.tests.downstream.optaweb-vehicle-routing_ws-cleanup_1664178120425/bc/kiegroup_optaweb_vehicle_routing/optaweb-vehicle-routing/optaweb-vehicle-routing-frontend/node_modules/eslint-config-airbnb-base/node_modules/es-abstract/2017/EnumerableOwnProperties.js’: No such file or directory
[2022-09-26T07:42:04.335Z] du: cannot access ‘/home/jenkins/workspace/KIE/optaplanner/main/pullrequest/optaplanner.tests.downstream.optaweb-vehicle-routing_ws-cleanup_1664178120425/bc/kiegroup_optaweb_vehicle_routing/optaweb-vehicle-routing/optaweb-vehicle-routing-frontend/node_modules/eslint-config-airbnb-base/node_modules/es-abstract/2017/FromPropertyDescriptor.js’: No such file or directory
[2022-09-26T07:42:04.335Z] du: cannot access ‘/home/jenkins/workspace/KIE/optaplanner/main/pullrequest/optaplanner.tests.downstream.optaweb-vehicle-routing_ws-cleanup_1664178120425/bc/kiegroup_optaweb_vehicle_routing/optaweb-vehicle-routing/optaweb-vehicle-routing-frontend/node_modules/eslint-config-airbnb-base/node_modules/es-abstract/2017/Get.js’: No such file or directory
[2022-09-26T07:42:04.335Z] du: cannot access ‘/home/jenkins/workspace/KIE/optaplanner/main/pullrequest/optaplanner.tests.downstream.optaweb-vehicle-routing_ws-cleanup_1664178120425/bc/kiegroup_optaweb_vehicle_routing/optaweb-vehicle-routing/optaweb-vehicle-routing-frontend/node_modules/eslint-config-airbnb-base/node_modules/es-abstract/2017/GetIterator.js’: No such file or directory
[2022-09-26T07:42:04.335Z] 327M /home/jenkins/workspace
[2022-09-26T07:42:04.335Z] 0 /home/jenkins/.pki
[2022-09-26T07:42:04.335Z] 139M /home/jenkins/tools
[2022-09-26T07:42:04.335Z] 0 /home/jenkins/caches
[2022-09-26T07:42:04.335Z] 138M /home/jenkins/.npm
[2022-09-26T07:42:04.335Z] 8.0K /home/jenkins/.java
[2022-09-26T07:42:04.335Z] 0 /home/jenkins/.mozilla
[2022-09-26T07:42:04.335Z] 2.9G /home/jenkins
[Pipeline] }
[Pipeline] // dir
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Install build-chain tool)
Stage "Install build-chain tool" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Build projects)
Stage "Build projects" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Sonar analysis)
Stage "Sonar analysis" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (check space after build)
Stage "check space after build" skipped due to earlier failure(s)
[Pipeline] }
[Pipeline] // stage
[Pipeline] stage
[Pipeline] { (Declarative: Post Actions)
[Pipeline] script
[Pipeline] {
[Pipeline] sh
[2022-09-26T07:42:05.247Z] + wget --no-check-certificate -qO - https://eng-jenkins-csb-business-automation.apps.ocp-c1.prod.psi.redhat.com/job/KIE/job/kogito/job/main/job/pullrequest/job/kogito-runtimes.tests.downstream.kogito-examples/1130/api/json
[Pipeline] readJSON
[Pipeline] sh

@sonarcloud
Copy link

sonarcloud bot commented Oct 4, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

92.0% 92.0% Coverage
4.1% 4.1% Duplication

@kbowers-ibm kbowers-ibm marked this pull request as ready for review October 4, 2022 13:03
@baldimir
Copy link
Contributor

baldimir commented Oct 4, 2023

Hi @kbowers-ibm, @elguardian, is this still relevant please? If yes, could you please rebase with the latest changes from main?

@kbowers-ibm kbowers-ibm removed the request for review from elguardian January 2, 2024 14:55
# Conflicts:
#	jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/LightProcessRuntime.java
#	jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/ProcessRuntimeImpl.java
#	jbpm/jbpm-flow/src/main/java/org/jbpm/process/instance/event/KogitoProcessEventSupportImpl.java
#	jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/validation/RuleFlowProcessValidator.java
#	jbpm/jbpm-flow/src/main/java/org/jbpm/workflow/instance/node/RuleSetNodeInstance.java
#	kogito-codegen-modules/kogito-codegen-processes/src/main/java/org/kie/kogito/codegen/process/MessageConsumerGenerator.java
@kbowers-ibm kbowers-ibm closed this Jan 3, 2024
@kbowers-ibm kbowers-ibm deleted the KOGITO-7977 branch August 15, 2024 08:46
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