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

use spotless to format code with plantirJavaFormat #572

Merged
merged 6 commits into from Mar 2, 2023
Merged

Conversation

amesbah
Copy link
Member

@amesbah amesbah commented Mar 1, 2023

No description provided.

if (ruleTwelve(node)) {
LOG.debug("Rule12 Applied");
/**
* Applies VIPS rules on {@code TR;>} node.
Copy link
Contributor

Choose a reason for hiding this comment

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

EscapedEntity: HTML entities in @code/@literal tags will appear literally in the rendered javadoc.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

public boolean equals(Object object) {
if (object instanceof AlchemyGraphModel) {
AlchemyGraphModel that = (AlchemyGraphModel) object;
return Objects.equal(this.nodes, that.nodes) && Objects.equal(this.links, that.links);
Copy link
Contributor

Choose a reason for hiding this comment

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

0% of developers fix this issue

ArrayEquals: Reference equality used to compare arrays


Suggested change
return Objects.equal(this.nodes, that.nodes) && Objects.equal(this.links, that.links);
return Arrays.equals(this.nodes, that.nodes) && Objects.equal(this.links, that.links);

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

public boolean equals(Object object) {
if (object instanceof AlchemyGraphModel) {
AlchemyGraphModel that = (AlchemyGraphModel) object;
return Objects.equal(this.nodes, that.nodes) && Objects.equal(this.links, that.links);
Copy link
Contributor

Choose a reason for hiding this comment

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

0% of developers fix this issue

ArrayEquals: Reference equality used to compare arrays


Suggested change
return Objects.equal(this.nodes, that.nodes) && Objects.equal(this.links, that.links);
return Objects.equal(this.nodes, that.nodes) && Arrays.equals(this.links, that.links);

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

saveToImage(subImage, target);
} catch (Exception ex) {
LOG.error("Error exporting rectangle to image " + rect);
LOG.debug(ex.getStackTrace().toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

10% of developers fix this issue

ArrayToString: Calling toString on an array does not provide useful information


Suggested change
LOG.debug(ex.getStackTrace().toString());
LOG.debug(Throwables.getStackTraceAsString(ex));

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

sourceState = eventable.getEdgeSource();

if (target != -1 && source != target) {
List<Eventable> fix = getEventable(target, source, allEventables);
Copy link
Contributor

Choose a reason for hiding this comment

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

ArgumentSelectionDefectChecker: The following arguments may have been swapped: 'target' for formal parameter 'source', 'source' for formal parameter 'target'. Either add clarifying /* paramName= */ comments, or swap the arguments if that is what was intended


Suggested change
List<Eventable> fix = getEventable(target, source, allEventables);
List<Eventable> fix = getEventable(source, target, allEventables);

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

Rectangle finalRect = null;
Rectangle boxRect = VipsUtils.getRectangle(vipsBlock, driver);
if (boxRect == null) {
boxRect = new Rectangle(rect2.x, rect2.y, rect2.height, rect2.width);
Copy link
Contributor

Choose a reason for hiding this comment

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

ArgumentSelectionDefectChecker: The following arguments may have been swapped: 'rect2.height' for formal parameter 'width', 'rect2.width' for formal parameter 'height'. Either add clarifying /* paramName= */ comments, or swap the arguments if that is what was intended


Suggested change
boxRect = new Rectangle(rect2.x, rect2.y, rect2.height, rect2.width);
boxRect = new Rectangle(rect2.x, rect2.y, rect2.width, rect2.height);

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

* Compares PageObject based on its position and size.
*/
public class GeographicMatchComparator {
Copy link
Contributor

Choose a reason for hiding this comment

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

40% of developers fix this issue

ClassCanBeStatic: Inner class is non-static but does not reference enclosing class


Suggested change
public class GeographicMatchComparator {
public static class GeographicMatchComparator {

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


@Override
public int hashCode() {
return Objects.hashCode(nodes, links);
Copy link
Contributor

Choose a reason for hiding this comment

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

ArrayHashCode: hashcode method on array does not hash array contents


Suggested change
return Objects.hashCode(nodes, links);
return Objects.hashCode(Arrays.hashCode(nodes), Arrays.hashCode(links));

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

*
* @param eventType the event type for this crawl element.
*/
protected CrawlElement(EventType eventType, String tagName) {
Copy link
Contributor

Choose a reason for hiding this comment

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

39% of developers fix this issue

ProtectedMembersInFinalClass: Make members of final classes package-private: CrawlElement, getConditions, setConditions, getInputFieldIds, addInputFieldIds, escapeApostrophes


Suggested change
protected CrawlElement(EventType eventType, String tagName) {
CrawlElement(EventType eventType, String tagName) {

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


@Override
public String toString() {
return this.getClass().getSimpleName() + "." + this.name();
Copy link
Contributor

Choose a reason for hiding this comment

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

GetClassOnEnum: Calling getClass() on an enum may return a subclass of the enum type


Suggested change
return this.getClass().getSimpleName() + "." + this.name();
return this.getDeclaringClass().getSimpleName() + "." + this.name();

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

return Integer.toString(Math.abs(random.nextInt()) % MAX_INT);
}
public String getRandomNumber() {
return Integer.toString(Math.abs(random.nextInt()) % MAX_INT);
Copy link
Contributor

Choose a reason for hiding this comment

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

0% of developers fix this issue

MathAbsoluteNegative: Math.abs does not always give a positive result. Please consider other methods for positive numbers.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}
boolean completed = pool.invoke(
new Comparison(aA, aB, la, bA, bB, lb, pixelsFailed, pixDiff, adaptationLevel, cpd, freq).rootTask());
assert completed | failFast;
Copy link
Contributor

Choose a reason for hiding this comment

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

ShortCircuitBoolean: Prefer the short-circuiting boolean operators && and || to & and |.


Suggested change
assert completed | failFast;
assert completed || failFast;

ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

*/
public static Object xmlToObject(String fileName) throws FileNotFoundException {
FileInputStream fi = new FileInputStream(fileName);
XMLDecoder decoder = new XMLDecoder(fi);
Copy link
Contributor

Choose a reason for hiding this comment

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

XML_DECODER: It is not safe to use an XMLDecoder to parse user supplied data


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

return null;
}
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
Copy link
Contributor

Choose a reason for hiding this comment

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

25% of developers fix this issue

WEAK_MESSAGE_DIGEST_MD5: This API MD5 (MDX) is not a recommended cryptographic hash function


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

tries.replace(input, true);
}
for (FormInput input : tries.keySet()) {
if (!tries.get(input)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

11% of developers fix this issue

INEFFICIENT_KEYSET_ITERATOR: Accessing a value using a key that was retrieved from a keySet iterator. It is more efficient to use an iterator on the entrySet of the map, avoiding the extra HashMap.get(key) lookup.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

private void copySkeletonFromJar(URL skeleton) {
LOG.debug("Loading skeleton as JAR entry {}", skeleton);
File jar = getJar(skeleton);
try (ZipInputStream zis = new ZipInputStream(new FileInputStream(jar))) {
Copy link
Contributor

Choose a reason for hiding this comment

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

PULSE_RESOURCE_LEAK: Resource dynamically allocated by constructor java.io.FileInputStream() on line 110 is not closed after the last access at line 110.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

return null;
}
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
Copy link
Contributor

Choose a reason for hiding this comment

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

21% of developers fix this issue

opt.semgrep.java.lang.security.audit.crypto.weak-hash.use-of-md5: Detected MD5 hash algorithm which is considered insecure. MD5 is not
collision resistant and is therefore not suitable as a cryptographic
signature. Use SHA256 or SHA3 instead.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

public void writeXML(VisualStructure visualStructure, BufferedImage pageViewport, String url, String title) {
try {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Copy link
Contributor

Choose a reason for hiding this comment

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

0% of developers fix this issue

opt.semgrep.documentbuilderfactory-disallow-doctype-decl-missing: DOCTYPE declarations are enabled for this DocumentBuilderFactory. This is vulnerable to XML external entity attacks. Disable this by setting the feature "http://apache.org/xml/features/disallow-doctype-decl" to true. Alternatively, allow DOCTYPE declarations and only prohibit external entities declarations. This can be done by setting the features "http://xml.org/sax/features/external-general-entities" and "http://xml.org/sax/features/external-parameter-entities" to false.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Copy link
Contributor

Choose a reason for hiding this comment

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

23% of developers fix this issue

CatchAndPrintStackTrace: Logging or rethrowing exceptions should usually be preferred to catching and calling printStackTrace

❗❗ 24 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 1158
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/OfflineTestGenerator.java 98
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/crawlPlugins/AddressbookCleanup.java 52
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 600
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/crawlPlugins/ClarolineCleanup.java 42
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/crawlPlugins/AddressbookCleanup.java 88
plugins/test-plugin/src/main/java/com/crawljax/plugins/testplugin/TestPlugin.java 33
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/OfflineTestGenerator.java 457
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/crawlPlugins/AddressbookCleanup.java 60
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteGenerator.java 129

Showing 10 of 24 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}

/**
* @param eventSequence The event sequence.
Copy link
Contributor

Choose a reason for hiding this comment

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

36% of developers fix this issue

MissingSummary: A summary line is required on public/protected Javadocs.

❗❗ 297 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/report/TestRecord.java 44
core/src/main/java/com/crawljax/core/configuration/Form.java 73
core/src/main/java/com/crawljax/core/configuration/PreCrawlConfiguration.java 96
core/src/main/java/com/crawljax/stateabstractions/hybrid/structuralvisualdiff/StructuralVisualDiff.java 305
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/visualdiff/pageobjects/PageObject.java 138
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/visualdiff/pageobjects/PageObject.java 98
core/src/main/java/com/crawljax/stateabstractions/hybrid/structuralvisualdiff/StructuralVisualDiff.java 312
core/src/main/java/com/crawljax/condition/crawlcondition/CrawlCondition.java 41
core/src/main/java/com/crawljax/core/configuration/CrawlRules.java 505
core/src/main/java/com/crawljax/core/configuration/CrawlRules.java 436

Showing 10 of 297 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

try {
tlsh2 = new TLSH(dom2);
digest2 = new DigestBuilder().withHash(tlsh2.hash()).build();
} catch (com.idealista.tlsh.exceptions.InsufficientComplexityException e) {
Copy link
Contributor

Choose a reason for hiding this comment

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

12% of developers fix this issue

UnnecessarilyFullyQualified: This fully qualified name is unambiguous to the compiler if imported.


Suggested change
} catch (com.idealista.tlsh.exceptions.InsufficientComplexityException e) {
} catch (InsufficientComplexityException e) {

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/stateabstractions/dom/TLSHStateVertexFactory.java 40
core/src/main/java/com/crawljax/stateabstractions/dom/RTED/RTEDUtils.java 55

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

public boolean equals(Object object) {
if (object instanceof StateCounter) {
StateCounter that = (StateCounter) object;
return Objects.equal(this.id, that.id) && Objects.equal(this.count, that.count);
Copy link
Contributor

Choose a reason for hiding this comment

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

60% of developers fix this issue

ObjectEqualsForPrimitives: Avoid unnecessary boxing by using plain == for primitive types.


Suggested change
return Objects.equal(this.id, that.id) && Objects.equal(this.count, that.count);
return Objects.equal(this.id, that.id) && (this.count == that.count);

❗❗ 27 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/configuration/BrowserConfiguration.java 145
core/src/main/java/com/crawljax/core/configuration/CrawlRules.java 238
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/State.java 199
core/src/main/java/com/crawljax/core/configuration/CrawlRules.java 233
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/CandidateElementPosition.java 103
core/src/main/java/com/crawljax/condition/CountCondition.java 68
core/src/main/java/com/crawljax/core/configuration/CrawlRules.java 232
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/AlchemyEdge.java 79
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/CandidateElementPosition.java 102
core/src/main/java/com/crawljax/core/configuration/CrawlRules.java 234

Showing 10 of 27 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

* {@link HybridStateVertexImpl#getDomFragments}
*
* @param fragmentMap
* @param driver
Copy link
Contributor

Choose a reason for hiding this comment

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

20% of developers fix this issue

EmptyBlockTag: A block tag (@param, @return, @throws, @deprecated) has an empty description. Block tags without descriptions don't add much value for future readers of the code; consider removing the tag entirely or adding a description.


Suggested change
* @param driver
*

❗❗ 223 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/stateabstractions/dom/RTED/RTED_InfoTree_Opt.java 488
core/src/main/java/com/crawljax/stateabstractions/dom/RTED/RTED_InfoTree_Opt.java 900
core/src/main/java/com/crawljax/forms/FormInputValueHelper.java 334
core/src/main/java/com/crawljax/forms/RandomInputValueGenerator.java 20
core/src/main/java/com/crawljax/stateabstractions/hybrid/HybridStateVertexImpl.java 888
core/src/main/java/com/crawljax/fragmentation/FragmentManager.java 107
core/src/main/java/com/crawljax/stateabstractions/dom/RTED/RTED_InfoTree_Opt.java 576
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsSeparatorGraphicsDetector.java 574
core/src/main/java/com/crawljax/fragmentation/FragmentManager.java 894
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/JavaTestGenerator.java 173

Showing 10 of 223 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

sb.append(ch);
break;
}
public static String commaSeparatedList(String[] list, char quote) {
Copy link
Contributor

Choose a reason for hiding this comment

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

11% of developers fix this issue

AvoidObjectArrays: Avoid accepting a String[]; consider an Iterable instead

❗❗ 13 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/FormatUtilities.java 65
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/AlchemyGraphModel.java 19
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/AlchemyGraphModel.java 14
core/src/main/java/com/crawljax/core/state/CrawlPath.java 120
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsUtils.java 94
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/APTED.java 491
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/AlchemyGraphModel.java 14
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/CommandLine.java 87
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/APTED.java 261
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/FormatUtilities.java 86

Showing 10 of 13 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

for (PageObject pageObject : otherPage.getUnclassifiedObjects()) {
otherObjects = otherObjects.add(pageObject, pageObject.getRectangle());
/* Find exact matches. */
List<PageObject> toRemove = new LinkedList<PageObject>();
Copy link
Contributor

Choose a reason for hiding this comment

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

16% of developers fix this issue

JdkObsolete: It is very rare for LinkedList to out-perform ArrayList or ArrayDeque. Avoid it unless you're willing to invest a lot of time into benchmarking. Caveat: LinkedList supports null elements, but ArrayDeque does not.


Suggested change
List<PageObject> toRemove = new LinkedList<PageObject>();
List<PageObject> toRemove = new ArrayList<PageObject>();

❗❗ 24 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/APTED.java 536
core/src/main/java/com/crawljax/stateabstractions/hybrid/HybridStateVertexImpl.java 141
core/src/main/java/com/crawljax/core/CrawlQueue.java 16
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/APTED.java 537
core/src/main/java/com/crawljax/stateabstractions/dom/RTED/LabelDictionary.java 41
core/src/main/java/com/crawljax/core/CandidateElementExtractor.java 113
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/FormatUtilities.java 68
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/visualdiff/pageobjects/Page.java 125
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/APTED.java 315
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/APTED.java 535

Showing 10 of 24 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

public void purgeActionsForState(StateVertex crawlTask) {
Lock lock = locks.get(crawlTask.getId());
try {
lock.lock();
Copy link
Contributor

Choose a reason for hiding this comment

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

LockNotBeforeTry: Prefer obtaining the lock for lock outside the try block. That way, if #lock throws, the lock is not erroneously released.


Suggested change
lock.lock();
lock.lock();try {

❗❗ 5 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/UnfiredFragmentCandidates.java 523
core/src/main/java/com/crawljax/core/UnfiredCandidateActions.java 111
core/src/main/java/com/crawljax/core/UnfiredFragmentCandidates.java 301
core/src/main/java/com/crawljax/core/UnfiredCandidateActions.java 260
core/src/main/java/com/crawljax/core/UnfiredCandidateActions.java 63

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

for (StateBuilder state : states.values()) {
builder.put(state.getName(), state.build());
private ImmutableMap<String, State> buildStates() {
Builder<String, State> builder = ImmutableMap.builder();
Copy link
Contributor

Choose a reason for hiding this comment

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

24% of developers fix this issue

BadImport: Importing nested classes/static methods/static fields with commonly-used names can make code harder to read, because it may not be clear from the context exactly which type is being referred to. Qualifying the name with that of the containing class can make the code clearer. Here we recommend using qualified class: ImmutableMap.


Suggested change
Builder<String, State> builder = ImmutableMap.builder();
ImmutableMap.Builder<String, State> builder = ImmutableMap.builder();

❗❗ 8 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/state/Element.java 48
core/src/main/java/com/crawljax/core/configuration/CrawlRules.java 142
core/src/main/java/com/crawljax/core/CandidateElementExtractor.java 225
core/src/main/java/com/crawljax/core/configuration/InputSpecification.java 85
core/src/main/java/com/crawljax/util/XPathHelper.java 253
core/src/main/java/com/crawljax/condition/eventablecondition/EventableConditionChecker.java 27
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/BeanToReadableMap.java 38
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 415

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

* @param eventable the eventable element.
* @return
*/
private List<FormInput> handleInputElements(Eventable eventable) {
Copy link
Contributor

Choose a reason for hiding this comment

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

25% of developers fix this issue

UnusedMethod: Method 'handleInputElements' is never used.

❗❗ 19 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/OutputBuilder.java 163
core/src/main/java/com/crawljax/stateabstractions/hybrid/StructuralVisualStateVertexFactory.java 35
core/src/main/java/com/crawljax/forms/FormHandler.java 130
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/AlchemyEdge.java 40
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 757
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteGeneratorHelper.java 230
core/src/main/java/com/crawljax/browser/WebDriverBackedEmbeddedBrowser.java 864
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/OfflineTestGenerator.java 515
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/AllPossibleMappingsTED.java 294
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/util/WorkDirManager.java 44

Showing 10 of 19 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}

public Date getStartDate() {
return new Date(startDate.getTime());
Copy link
Contributor

Choose a reason for hiding this comment

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

18% of developers fix this issue

JavaUtilDate: Date has a bad API that leads to bugs; prefer java.time.Instant or LocalDate.

❗❗ 14 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/OutPutModelCache.java 38
core/src/main/java/com/crawljax/core/CrawlSession.java 62
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/Statistics.java 82
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/FormatUtilities.java 108
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/JavaTestGenerator.java 106
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/FormatUtilities.java 109
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/CommandLine.java 231
core/src/main/java/com/crawljax/core/CrawlSession.java 62
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/CommandLine.java 227
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/CommandLine.java 231

Showing 10 of 14 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

* this.fanOut = fanOut; this.id = id; this.failedEvents = failedEvents; }
*/

public int getCluster() {
Copy link
Contributor

Choose a reason for hiding this comment

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

AlmostJavadoc: This comment contains Javadoc or HTML tags, but isn't started with a double asterisk (/**); is it meant to be Javadoc?


Suggested change
public int getCluster() {
/**

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/model/State.java 43
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/util/WorkDirManager.java 158

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}
throw new StateUnreachableException(
targetState,
String.format(
Copy link
Contributor

Choose a reason for hiding this comment

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

FormatString: format specifier '%b' is not compatible with the given flag(s):

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/Crawler.java 646
core/src/main/java/com/crawljax/core/Crawler.java 790

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


@Override
public boolean equals(Object object) {
HybridStateVertexImpl that = (HybridStateVertexImpl) object;
Copy link
Contributor

Choose a reason for hiding this comment

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

14% of developers fix this issue

EqualsUnsafeCast: The contract of #equals states that it should return false for incompatible types, while this implementation may throw ClassCastException.


Suggested change
HybridStateVertexImpl that = (HybridStateVertexImpl) object;
if (!(object instanceof HybridStateVertexImpl)) { return false; }HybridStateVertexImpl that = (HybridStateVertexImpl) object;

❗❗ 3 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/stateabstractions/dom/LevenshteinStateVertexImpl.java 48
core/src/main/java/com/crawljax/stateabstractions/dom/RTEDStateVertexImpl.java 47
core/src/main/java/com/crawljax/stateabstractions/dom/TLSHStateVertexImpl.java 78

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


applyNonSelAdvantage = crawlRules.isApplyNonSelAdvantage();
skipExploredActions = crawlRules.isSkipExploredActions();
MAX_REPEAT = crawlRules.getMaxRepeatExploredActions();
Copy link
Contributor

Choose a reason for hiding this comment

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

41% of developers fix this issue

StaticAssignmentInConstructor: This assignment is to a static field. Mutating static state from a constructor is highly error-prone.

❗❗ 12 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/stateabstractions/dom/LevenshteinStateVertexFactory.java 22
core/src/main/java/com/crawljax/stateabstractions/visual/imagehashes/PerceptualImageHashStateVertexFactory.java 31
core/src/main/java/com/crawljax/stateabstractions/hybrid/FragGenStateVertexFactory.java 23
core/src/main/java/com/crawljax/stateabstractions/dom/TLSHStateVertexFactory.java 28
core/src/main/java/com/crawljax/stateabstractions/dom/TLSHStateVertexFactory.java 27
core/src/main/java/com/crawljax/stateabstractions/visual/PDiffStateVertexFactory.java 26
core/src/main/java/com/crawljax/stateabstractions/visual/SIFTStateVertexFactory.java 26
core/src/main/java/com/crawljax/stateabstractions/visual/SSIMStateVertexFactory.java 26
core/src/main/java/com/crawljax/stateabstractions/visual/imagehashes/BlockMeanImageHashStateVertexFactory.java 30
core/src/main/java/com/crawljax/stateabstractions/dom/RTEDStateVertexFactory.java 18

Showing 10 of 12 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

for (int rF = rFfirst; rF >= rFlast; rF--) {
q[rF] = s[rF - it1PreRoff][(parent_of_lG_in_preR + 1) - it2PreRoff];
// Deal with nodes to the right of the path.
if (pathType == 0 || pathType == 2 && rightPart || pathType == 2 && !leftPart && !rightPart) {
Copy link
Contributor

Choose a reason for hiding this comment

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

36% of developers fix this issue

OperatorPrecedence: Use grouping parenthesis to make the operator precedence explicit


Suggested change
if (pathType == 0 || pathType == 2 && rightPart || pathType == 2 && !leftPart && !rightPart) {
if (pathType == 0 || (pathType == 2 && rightPart) || pathType == 2 && !leftPart && !rightPart) {

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/APTED.java 1202
core/src/main/java/com/crawljax/stateabstractions/dom/apted/distance/APTED.java 950

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

String eventListeners;

public VipsBrowserAttributes(
Rectangle rect, int fontSize, int fontWeight, String bgColor, boolean isDisplayed2, String eventListeners) {
Copy link
Contributor

Choose a reason for hiding this comment

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

70% of developers fix this issue

InconsistentCapitalization: Found the field 'bgcolor' with the same name as the parameter 'bgColor' but with different capitalization.


Suggested change
Rectangle rect, int fontSize, int fontWeight, String bgColor, boolean isDisplayed2, String eventListeners) {
Rectangle rect, int fontSize, int fontWeight, String bgcolor, boolean isDisplayed2, String eventListeners) {

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsBrowserAttributes.java 15
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsBrowserAttributes.java 15

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}
tokens.add(textNode.getNodeValue().trim());
}
} catch (XPathExpressionException ignored) {
Copy link
Contributor

Choose a reason for hiding this comment

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

34% of developers fix this issue

EmptyCatch: Caught exceptions should not be ignored

❗❗ 4 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/UnfiredFragmentCandidates.java 346
core/src/main/java/com/crawljax/core/UnfiredFragmentCandidates.java 162
core/src/main/java/com/crawljax/util/DomUtils.java 669
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsUtils.java 350

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


@Override
public boolean equals(Object o) {
Copy link
Contributor

Choose a reason for hiding this comment

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

16% of developers fix this issue

EqualsHashCode: Classes that override equals should also override hashCode.

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/fragmentation/FragmentOutput.java 160
core/src/main/java/com/crawljax/fragmentation/FragmentPair.java 42

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

case DUPLICATE:
case NEARDUPLICATE1:
LOG.info("This is a good path. Save it!!");
case NEARDUPLICATE2:
Copy link
Contributor

Choose a reason for hiding this comment

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

FallThrough: Execution may fall through from the previous case; add a // fall through comment before this line if it was deliberate

❗❗ 3 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/fragDiff/FragDiff.java 139
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsUtils.java 1182
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/OfflineTestGenerator.java 217

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

}
@Override
public Runnable poll(long timeout, TimeUnit unit) {
return remove();
Copy link
Contributor

Choose a reason for hiding this comment

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

GuardedBy: This access should be guarded by 'this', which is not currently held

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/CrawlQueue.java 83
core/src/main/java/com/crawljax/core/CrawlQueue.java 72

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

LOG.debug("Starting {} consumers", config.getBrowserConfig().getNumberOfBrowsers());
executor.submit(firstConsumer);
for (int i = 1; i < config.getBrowserConfig().getNumberOfBrowsers(); i++) {
executor.submit(consumerFactory.get());
Copy link
Contributor

Choose a reason for hiding this comment

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

38% of developers fix this issue

FutureReturnValueIgnored: Return value of methods returning Future must be checked. Ignoring returned Futures suppresses exceptions thrown from the code that completes the Future.

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/CrawlController.java 108
core/src/main/java/com/crawljax/core/CrawlController.java 122

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

*/
void persistDom(String name, @Nullable String dom) {
try {
Files.write(Strings.nullToEmpty(dom), new File(doms, name + ".html"), Charsets.UTF_8);
Copy link
Contributor

Choose a reason for hiding this comment

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

InlineMeInliner: Migrate (via inlining) away from deprecated Files.write().


Suggested change
Files.write(Strings.nullToEmpty(dom), new File(doms, name + ".html"), Charsets.UTF_8);
Files.asCharSink(new File(doms, name + ".html"), Charsets.UTF_8).write(Strings.nullToEmpty(dom));

❗❗ 2 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/OutputBuilder.java 256
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/OutputBuilder.java 216

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

buf.append("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", index, index + 1);
public static final double PROBABILITY_CHECK = 0.5;
private static final int MAX_INT = 12345;
private final Random random = new Random();
Copy link
Contributor

Choose a reason for hiding this comment

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

14% of developers fix this issue

PREDICTABLE_RANDOM: This random generator (java.util.Random) is predictable

❗❗ 4 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/Crawler.java 1034
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/visualdiff/ObjectDetection.java 229
core/src/main/java/com/crawljax/stateabstractions/dom/apted/util/FormatUtilities.java 109
core/src/main/java/com/crawljax/forms/RandomInputValueGenerator.java 26

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

* @throws FileNotFoundException On error.
*/
public static Object xmlToObject(String fileName) throws FileNotFoundException {
FileInputStream fi = new FileInputStream(fileName);
Copy link
Contributor

Choose a reason for hiding this comment

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

6% of developers fix this issue

PATH_TRAVERSAL_IN: This API (java/io/FileInputStream.(Ljava/lang/String;)V) reads a file whose location might be specified by user input

❗❗ 82 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/JavaTestGenerator.java 205
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 396
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/OutputBuilder.java 149
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/util/WorkDirManager.java 121
plugins/crawloverview-plugin/src/main/java/com/crawljax/plugins/crawloverview/OutputBuilder.java 247
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/OfflineTestGenerator.java 346
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/OfflineTestGenerator.java 377
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsUtils.java 810
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 1050
core/src/main/java/com/crawljax/core/configuration/CrawljaxConfiguration.java 152

Showing 10 of 82 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

private String getSource(Node elementBox) {
String content = "";
try {
TransformerFactory transFactory = TransformerFactory.newInstance();
Copy link
Contributor

Choose a reason for hiding this comment

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

XXE_DTD_TRANSFORM_FACTORY: The use of TransformerFactory.newInstance(...) (TransformerFactory) is vulnerable to XML External Entity attacks

❗❗ 6 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/util/DomUtils.java 270
core/src/main/java/com/crawljax/util/DomUtils.java 474
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsOutput.java 302
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/util/WorkDirManager.java 129
core/src/main/java/com/crawljax/util/DomUtils.java 250
vips_selenium/src/main/java/com/crawljax/vips_selenium/DomUtils.java 32

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

* @throws FileNotFoundException On error.
*/
public static void objectToXML(Object object, String fileName) throws FileNotFoundException {
FileOutputStream fo = new FileOutputStream(fileName);
Copy link
Contributor

Choose a reason for hiding this comment

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

4% of developers fix this issue

PATH_TRAVERSAL_OUT: This API (java/io/FileOutputStream.(Ljava/lang/String;)V) writes to a file whose location might be specified by user input

❗❗ 6 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteGeneratorHelper.java 251
core/src/main/java/com/crawljax/util/DomUtils.java 479
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 1154
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsOutput.java 321
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteGeneratorHelper.java 54
core/src/main/java/com/crawljax/stateabstractions/hybrid/structuralvisualdiff/StructuralVisualDiff.java 393

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

public static NodeList evaluateXpathExpression(Document dom, String xpathExpr) throws XPathExpressionException {
XPathFactory factory = XPathFactory.newInstance();
XPath xpath = factory.newXPath();
XPathExpression expr = xpath.compile(xpathExpr);
Copy link
Contributor

Choose a reason for hiding this comment

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

XPATH_INJECTION: This use of javax/xml/xpath/XPath.compile(Ljava/lang/String;)Ljavax/xml/xpath/XPathExpression; can be vulnerable to XPath Injection

❗❗ 4 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/util/XPathHelper.java 236
core/src/main/java/com/crawljax/util/DomUtils.java 685
core/src/main/java/com/crawljax/util/DomUtils.java 164
core/src/main/java/com/crawljax/util/DomUtils.java 677

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

*/
public static byte[] getDocumentToByteArray(Document dom) {
try {
TransformerFactory tFactory = TransformerFactory.newInstance();
Copy link
Contributor

Choose a reason for hiding this comment

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

XXE_XSLT_TRANSFORM_FACTORY: The use of TransformerFactory.newInstance(...) is vulnerable to XSLT External Entity attacks

❗❗ 6 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsOutput.java 61
vips_selenium/src/main/java/com/crawljax/vips_selenium/DomUtils.java 32
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/util/WorkDirManager.java 129
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsOutput.java 302
core/src/main/java/com/crawljax/util/DomUtils.java 250
core/src/main/java/com/crawljax/util/DomUtils.java 474

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

removeStateFromQueue(state.getId());
LOG.debug("There are now {} states with unfinished actions", cache.size());
public void removeAction(CandidateElement candidate, StateVertex state) {
if (unreachableCache.get(state.getId()) != null) {
Copy link
Contributor

Choose a reason for hiding this comment

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

6% of developers fix this issue

THREAD_SAFETY_VIOLATION: Read/Write race. Non-private method UnfiredFragmentCandidates.removeAction(...) reads without synchronization from container this.unreachableCache via call to Map.get(...). Potentially races with write in method UnfiredFragmentCandidates.purgeActionsForState(...).
Reporting because another access to the same memory occurs on a background thread, although this access may not.

❗❗ 16 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/UnfiredFragmentCandidates.java 240
core/src/main/java/com/crawljax/forms/FormInputValueHelper.java 96
core/src/main/java/com/crawljax/core/UnfiredFragmentCandidates.java 512
core/src/main/java/com/crawljax/forms/FormInputValueHelper.java 85
core/src/main/java/com/crawljax/core/ExitNotifier.java 40
core/src/main/java/com/crawljax/core/CandidateElementManager.java 81
core/src/main/java/com/crawljax/core/ExitNotifier.java 63
core/src/main/java/com/crawljax/core/UnfiredFragmentCandidates.java 152
core/src/main/java/com/crawljax/core/ExitNotifier.java 31
core/src/main/java/com/crawljax/core/ExitNotifier.java 47

Showing 10 of 16 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]


public StateVertex addStateToReportBuilder(long StateVertexId) {
StateVertex vertex = getStateVertex(StateVertexId);
reportBuilder.addState(vertex);
Copy link
Contributor

Choose a reason for hiding this comment

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

8% of developers fix this issue

NULLPTR_DEREFERENCE: vertex could be null (from the call to TestSuiteHelper.getStateVertex(...) on line 1368) and is dereferenced in the call to ReportBuilder.addState(...).

❗❗ 33 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/plugin/Plugins.java 247
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsSeparatorNonGraphicsDetector.java 527
core/src/main/java/com/crawljax/core/plugin/Plugins.java 372
vips_selenium/src/main/java/com/crawljax/vips_selenium/VisualStructureConstructor.java 823
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsSeparatorGraphicsDetector.java 636
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsSeparatorNonGraphicsDetector.java 121
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 769
core/src/main/java/com/crawljax/core/plugin/Plugins.java 267
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsSeparatorGraphicsDetector.java 730
vips_selenium/src/main/java/com/crawljax/vips_selenium/VipsSeparatorGraphicsDetector.java 306

Showing 10 of 33 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

FileOutputStream fo = new FileOutputStream(fname);
fo.write((new Gson()).toJson(map).getBytes());
fo.close();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

10% of developers fix this issue

RESOURCE_LEAK: resource of type java.io.FileOutputStream acquired to fo by call to FileOutputStream(...) at line 251 is not released after line 254.
Note: potential exception at line 252

❗❗ 6 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/util/WorkDirManager.java 82
core/src/main/java/com/crawljax/stateabstractions/hybrid/structuralvisualdiff/StructuralVisualDiff.java 396
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 1279
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 1157
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/util/WorkDirManager.java 170
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteGeneratorHelper.java 57

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

plugin.name = source.getName();
plugin.description = source.getDescription();
for (String version : source.getCrawljaxVersions().getVersion()) {
plugin.getCrawljaxVersions().add(version);
Copy link
Contributor

Choose a reason for hiding this comment

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

18% of developers fix this issue

NULL_DEREFERENCE: object returned by getCrawljaxVersions(plugin) could be null and is dereferenced at line 54.

❗❗ 27 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/core/UnfiredFragmentCandidates.java 501
core/src/main/java/com/crawljax/fragmentation/Fragment.java 465
core/src/main/java/com/crawljax/stateabstractions/hybrid/HybridStateVertexImpl.java 319
core/src/main/java/com/crawljax/core/plugin/descriptor/Parameter.java 24
core/src/main/java/com/crawljax/stateabstractions/hybrid/HybridStateVertexImpl.java 387
core/src/main/java/com/crawljax/core/state/StateVertexImpl.java 296
core/src/main/java/com/crawljax/core/Crawler.java 391
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/TestSuiteHelper.java 616
core/src/main/java/com/crawljax/stateabstractions/hybrid/HybridStateVertexImpl.java 300
plugins/testcasegenerator-plugin/src/main/java/com/crawljax/plugins/testcasegenerator/fragDiff/FragDiff.java 218

Showing 10 of 27 findings. Visit the Lift Web Console to see all.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

public boolean check(EmbeddedBrowser browser) {
String js = "try{ if(" + expression + "){return '1';}else{" + "return '0';}}catch(e){" + " return '0';}";
try {
Object object = browser.executeJavaScript(js);
Copy link
Contributor

Choose a reason for hiding this comment

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

26% of developers fix this issue

INTERFACE_NOT_THREAD_SAFE: Unprotected call to method EmbeddedBrowser.executeJavaScript(...) of un-annotated interface com.crawljax.browser.EmbeddedBrowser. Consider annotating the interface with @ThreadSafe or adding a lock.
Reporting because a superclass class com.crawljax.condition.Condition is annotated @ThreadSafe.

❗❗ 10 similar findings have been found in this PR

🔎 Expand here to view all instances of this finding
File Path Line Number
core/src/main/java/com/crawljax/condition/VisibleCondition.java 26
core/src/main/java/com/crawljax/oraclecomparator/StateComparator.java 41
core/src/main/java/com/crawljax/condition/XPathCondition.java 34
core/src/main/java/com/crawljax/condition/browserwaiter/WaitCondition.java 82
core/src/main/java/com/crawljax/condition/ConditionTypeChecker.java 37
core/src/main/java/com/crawljax/condition/RegexCondition.java 31
core/src/main/java/com/crawljax/condition/browserwaiter/ExpectedElementCondition.java 28
core/src/main/java/com/crawljax/condition/browserwaiter/WaitConditionChecker.java 43
core/src/main/java/com/crawljax/condition/UrlCondition.java 27
core/src/main/java/com/crawljax/condition/browserwaiter/ExpectedVisibleCondition.java 28

Visit the Lift Web Console to find more details in your report.


ℹ️ Expand to see all @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.


Help us improve LIFT! (Sonatype LiftBot external survey)

Was this a good recommendation for you? Answering this survey will not impact your Lift settings.

[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]

@sonatype-lift
Copy link
Contributor

sonatype-lift bot commented Mar 1, 2023

🛠 Lift Auto-fix

Some 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/crawljax/crawljax/572.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/crawljax/crawljax/572.diff | git apply

Once you're satisfied, commit and push your changes in your project.

Footnotes

  1. You can preview the patch by opening the patch URL in the browser.

@amesbah amesbah merged commit 42e9fba into master Mar 2, 2023
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.

None yet

1 participant