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

Issue 11609 fixes #13216

Merged
merged 33 commits into from
Dec 15, 2017
Merged

Issue 11609 fixes #13216

merged 33 commits into from
Dec 15, 2017

Conversation

jdotcms
Copy link
Contributor

@jdotcms jdotcms commented Dec 14, 2017

No description provided.

jcastro-dotcms and others added 30 commits November 6, 2017 09:41
* @return Set of {@link WorkflowStatus}
*/
public Set<WorkflowStatus> getShowOn() {
return showOn;

Choose a reason for hiding this comment

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

MINOR Return a copy of "showOn". rule

private boolean assignable;
private boolean commentable;
private int order;
private Set<WorkflowStatus> showOn = Collections.emptySet();

Choose a reason for hiding this comment

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

MINOR Convert this Set to an EnumSet. rule

try {

existsScheme = null != this.findScheme(schemeId);
} catch (Exception e) {

Choose a reason for hiding this comment

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

MAJOR Either log or rethrow this exception. rule
MINOR Catch a list of specific exception subtypes instead. rule

new ImmutableList.Builder<>();

final List<Map<String, Object>> stepIdList =
new DotConnect().setSQL(sql.SELECT_STEPS_ID_BY_ACTION)

Choose a reason for hiding this comment

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

MAJOR Change this instance-reference to a static reference. rule


if (null != stepIdList) {

stepIdList.forEach( mapRow -> stepsBuilder.add

Choose a reason for hiding this comment

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

MINOR Specify a type for: 'mapRow' rule

*/
public static Set<WorkflowStatus> toSet(Object value) {

Set<WorkflowStatus> workflowStatusSet = Collections.emptySet();

Choose a reason for hiding this comment

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

MINOR Convert this Set to an EnumSet. rule



public Builder showOn(Set<WorkflowStatus> showOn) {
this.showOn = showOn;

Choose a reason for hiding this comment

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

MINOR Store a copy of "showOn". rule

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed

@@ -310,17 +311,19 @@ public void saveStep(WorkflowStep step) throws DotDataException, AlreadyExistExc
@WrapInTransaction
public void deleteStep(final WorkflowStep step) throws DotDataException {

Savepoint savepoint = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this variable is not used and can be delete it

PreparedStatement preparedStatement = null;
try {

preparedStatement = conn.prepareStatement(ALTER_TABLE + tableName + DROP_FOREIGN_KEY + constraintName);

Choose a reason for hiding this comment

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

BLOCKER Use a variable binding mechanism to construct this query instead of concatenation. rule

}

try {
preparedStatement = conn.prepareStatement(sql);

Choose a reason for hiding this comment

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

BLOCKER Use a variable binding mechanism to construct this query instead of concatenation. rule

@@ -4,6 +4,7 @@
import com.dotcms.contenttype.business.ContentTypeAPI;
import com.dotcms.repackage.com.google.common.annotations.VisibleForTesting;
import com.dotcms.repackage.org.apache.commons.beanutils.BeanUtils;
import com.dotcms.util.CollectionsUtils;

Choose a reason for hiding this comment

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

MINOR Remove this unused import 'com.dotcms.util.CollectionsUtils'. rule

@@ -60,6 +60,7 @@

import org.osgi.framework.BundleContext;

import java.sql.Savepoint;

Choose a reason for hiding this comment

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

MINOR Remove this unused import 'java.sql.Savepoint'. rule

@dotCMS dotCMS deleted a comment from jdotcms Dec 14, 2017
@dotCMS dotCMS deleted a comment from jdotcms Dec 14, 2017
@dotCMS dotCMS deleted a comment from jdotcms Dec 14, 2017
@dotCMS dotCMS deleted a comment from jdotcms Dec 14, 2017
@dotCMS dotCMS deleted a comment from jdotcms Dec 14, 2017
@dotCMS dotCMS deleted a comment from jdotcms Dec 14, 2017
@dotCMS dotCMS deleted a comment from jdotcms Dec 14, 2017
@dev-dotcms
Copy link

SonarQube analysis reported 27 issues

  • BLOCKER 2 blocker
  • CRITICAL 2 critical
  • MAJOR 5 major
  • MINOR 18 minor

Watch the comments in this conversation to review them.

2 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. CRITICAL WorkflowFactoryImpl.java#L188: Define a constant instead of duplicating this literal "stepid" 3 times. rule
  2. MINOR Task04305UpdateWorkflowActionTable.java#L371: Catch a list of specific exception subtypes instead. rule

@dotCMS dotCMS deleted a comment from jdotcms Dec 14, 2017
@jgambarios jgambarios merged commit 2fe3e6c into master Dec 15, 2017
@jgambarios jgambarios deleted the issue-11609-fixes branch December 15, 2017 15:33
@jdotcms jdotcms restored the issue-11609-fixes branch December 19, 2017 18:06
@jgambarios jgambarios mentioned this pull request Jan 8, 2018
@jgambarios jgambarios deleted the issue-11609-fixes branch January 8, 2018 19:27
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.

5 participants