SpotBugs Bug Detector Report

The following document contains the results of SpotBugs

SpotBugs Version is 4.9.8

Threshold is medium

Effort is max

Summary

Classes Bugs Errors Missing Classes
72 63 0 0

Files

Class Bugs
amd.Quantize$Cube 1
org.carrot2.labs.smartsprites.SmartSpritesParameters 2
org.carrot2.labs.smartsprites.SpriteBuilder 3
org.carrot2.labs.smartsprites.SpriteDirectiveOccurrenceCollector 3
org.carrot2.labs.smartsprites.SpriteImage 1
org.carrot2.labs.smartsprites.SpriteImageBuilder 8
org.carrot2.labs.smartsprites.SpriteImageDirective 2
org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteImageFormat 1
org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteImageLayout 1
org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteUidType 1
org.carrot2.labs.smartsprites.SpriteLayoutProperties 5
org.carrot2.labs.smartsprites.SpriteLayoutProperties$SpriteAlignment 1
org.carrot2.labs.smartsprites.SpriteReferenceOccurrence 16
org.carrot2.labs.smartsprites.ant.SmartSpritesTask$FailureDetectorMessageSink 1
org.carrot2.labs.smartsprites.css.CssSyntaxUtils 2
org.carrot2.labs.smartsprites.message.LevelCounterMessageSink 2
org.carrot2.labs.smartsprites.message.Message 1
org.carrot2.labs.smartsprites.message.PrintStreamMessageSink 1
org.carrot2.labs.smartsprites.resource.FileSystemResourceHandler 3
org.carrot2.labs.test.Assertions 2
org.carrot2.labs.test.BufferedImageAssertion 1
org.carrot2.labs.test.CssPropertyListAssertion 1
org.carrot2.labs.test.MessageListAssertion 3
org.carrot2.util.CollectionUtils 1

amd.Quantize$Cube

Bug Category Details Line Priority
Method amd.Quantize$Cube.classification() uses a Side Effect Constructor STYLE SEC_SIDE_EFFECT_CONSTRUCTOR 443 Medium

org.carrot2.labs.smartsprites.SmartSpritesParameters

Bug Category Details Line Priority
org.carrot2.labs.smartsprites.SmartSpritesParameters.getCssFiles() may expose internal representation by returning SmartSpritesParameters.cssFiles MALICIOUS_CODE EI_EXPOSE_REP 359 Medium
new org.carrot2.labs.smartsprites.SmartSpritesParameters(String, List, String, String, Message$MessageLevel, String, SmartSpritesParameters$PngDepth, String, boolean) may expose internal representation by storing an externally mutable object into SmartSpritesParameters.cssFiles MALICIOUS_CODE EI_EXPOSE_REP2 230 Medium

org.carrot2.labs.smartsprites.SpriteBuilder

Bug Category Details Line Priority
new org.carrot2.labs.smartsprites.SpriteBuilder(SmartSpritesParameters, MessageLog, ResourceHandler) may expose internal representation by storing an externally mutable object into SpriteBuilder.messageLog MALICIOUS_CODE EI_EXPOSE_REP2 116 Medium
Method org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites() does not presize the allocation of a collection PERFORMANCE PSC_PRESIZE_COLLECTIONS 166 Medium
Method org.carrot2.labs.smartsprites.SpriteBuilder.buildSprites(Collection) does not presize the allocation of a collection PERFORMANCE PSC_PRESIZE_COLLECTIONS 217 Medium

org.carrot2.labs.smartsprites.SpriteDirectiveOccurrenceCollector

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteDirectiveOccurrenceCollector.collectSpriteImageOccurrences(String) returns java.util.Collection CORRECTNESS IMC_IMMATURE_CLASS_COLLECTION_RETURN 99 Medium
Method org.carrot2.labs.smartsprites.SpriteDirectiveOccurrenceCollector.collectSpriteReferenceOccurrences(String, Map) returns java.util.Collection CORRECTNESS IMC_IMMATURE_CLASS_COLLECTION_RETURN 145 Medium
Method org.carrot2.labs.smartsprites.SpriteDirectiveOccurrenceCollector.extractSpriteReferenceCssProperty(String) makes literal string comparisons passing the literal as an argument STYLE LSC_LITERAL_STRING_COMPARISON 342 High

org.carrot2.labs.smartsprites.SpriteImage

Bug Category Details Line Priority
Primitive field org.carrot2.labs.smartsprites.SpriteImage.resolvedPath is public and set from inside the class, which makes it too exposed. Consider making it private to limit external accessibility. BAD_PRACTICE PA_PUBLIC_PRIMITIVE_ATTRIBUTE 159 Medium

org.carrot2.labs.smartsprites.SpriteImageBuilder

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImage(SpriteImageOccurrence, Map, MessageLog) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 298 Medium
Method org.carrot2.labs.smartsprites.SpriteImageBuilder.calculateLeastCommonMultiple(Map, SpriteImageDirective$SpriteImageLayout) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 388 Medium
Method org.carrot2.labs.smartsprites.SpriteImageBuilder.calculateLeastCommonMultiple(Map, SpriteImageDirective$SpriteImageLayout) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 389 Medium
Method org.carrot2.labs.smartsprites.SpriteImageBuilder.writeSprite(SpriteImage, BufferedImage) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 221 Medium
Test for floating point equality in org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImage(SpriteImageOccurrence, Map, MessageLog) STYLE FE_FLOATING_POINT_EQUALITY 334 High
Method org.carrot2.labs.smartsprites.SpriteImageBuilder.buildSpriteImage(SpriteImageOccurrence, Map, MessageLog) does not presize the allocation of a collection PERFORMANCE PSC_PRESIZE_COLLECTIONS 341 Medium
Method org.carrot2.labs.smartsprites.SpriteImageBuilder.getSpriteImageOccurrencesByLineNumber(Collection) does not presize the allocation of a collection PERFORMANCE PSC_PRESIZE_COLLECTIONS 433 Medium
Method org.carrot2.labs.smartsprites.SpriteImageBuilder.getSpriteReplacementsByLineNumber(Collection) does not presize the allocation of a collection PERFORMANCE PSC_PRESIZE_COLLECTIONS 414 Medium

org.carrot2.labs.smartsprites.SpriteImageDirective

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteImageDirective.parse(String, MessageLog) appears to call the same method on the same object redundantly PERFORMANCE PRMC_POSSIBLY_REDUNDANT_METHOD_CALLS 383 Medium
The regular expression "([^${}]*|\\$\\{[^}]*\\})*" is vulnerable to a denial of service attack (ReDOS) SECURITY REDOS 268 Medium

org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteImageFormat

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteImageFormat.valuesAsString() performs algorithmic operations on the result of a toString() call CORRECTNESS ITU_INAPPROPRIATE_TOSTRING_USE 220 Medium

org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteImageLayout

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteImageLayout.valuesAsString() performs algorithmic operations on the result of a toString() call CORRECTNESS ITU_INAPPROPRIATE_TOSTRING_USE 121 Medium

org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteUidType

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteImageDirective$SpriteUidType.valuesAsString() performs algorithmic operations on the result of a toString() call CORRECTNESS ITU_INAPPROPRIATE_TOSTRING_USE 170 Medium

org.carrot2.labs.smartsprites.SpriteLayoutProperties

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteLayoutProperties.correctAlignment(SpriteImageDirective$SpriteImageLayout, SpriteLayoutProperties$SpriteAlignment, MessageLog) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 278 Medium
Method org.carrot2.labs.smartsprites.SpriteLayoutProperties.correctAlignment(SpriteImageDirective$SpriteImageLayout, SpriteLayoutProperties$SpriteAlignment, MessageLog) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 279 Medium
Method org.carrot2.labs.smartsprites.SpriteLayoutProperties.correctAlignment(SpriteImageDirective$SpriteImageLayout, SpriteLayoutProperties$SpriteAlignment, MessageLog) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 283 Medium
Method org.carrot2.labs.smartsprites.SpriteLayoutProperties.getDefaultAlignment(SpriteImageDirective$SpriteImageLayout) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 300 Medium
This method org.carrot2.labs.smartsprites.SpriteLayoutProperties.getMargin(String, Map, int, MessageLog) parses a String that is a field STYLE STT_STRING_PARSING_A_FIELD 328 Medium

org.carrot2.labs.smartsprites.SpriteLayoutProperties$SpriteAlignment

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteLayoutProperties$SpriteAlignment.valuesAsString() performs algorithmic operations on the result of a toString() call CORRECTNESS ITU_INAPPROPRIATE_TOSTRING_USE 144 Medium

org.carrot2.labs.smartsprites.SpriteReferenceOccurrence

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.buildReplacement(SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 196 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.buildReplacement(SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 198 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.buildReplacement(SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 200 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.buildReplacement(SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 209 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.buildReplacement(SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 211 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.getRequiredHeight(BufferedImage, SpriteImageDirective$SpriteImageLayout) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 113 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.getRequiredHeight(BufferedImage, SpriteImageDirective$SpriteImageLayout) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 114 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.getRequiredWidth(BufferedImage, SpriteImageDirective$SpriteImageLayout) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 92 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.getRequiredWidth(BufferedImage, SpriteImageDirective$SpriteImageLayout) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 93 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(BufferedImage, SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 137 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(BufferedImage, SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 140 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(BufferedImage, SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 144 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(BufferedImage, SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 148 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(BufferedImage, SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 161 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(BufferedImage, SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 165 Medium
Method org.carrot2.labs.smartsprites.SpriteReferenceOccurrence.render(BufferedImage, SpriteImageDirective$SpriteImageLayout, int) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 169 Medium

org.carrot2.labs.smartsprites.ant.SmartSpritesTask$FailureDetectorMessageSink

Bug Category Details Line Priority
Method new org.carrot2.labs.smartsprites.ant.SmartSpritesTask$FailureDetectorMessageSink(SmartSpritesTask) sets an enum reference to null CORRECTNESS ENMI_NULL_ENUM_VALUE 244 Medium

org.carrot2.labs.smartsprites.css.CssSyntaxUtils

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.css.CssSyntaxUtils.hasNonBlankValue(Map, String) checks a map with containsKey(), before using get() CORRECTNESS MUI_CONTAINSKEY_BEFORE_GET 169 Medium
Method org.carrot2.labs.smartsprites.css.CssSyntaxUtils.propertiesAsMap(Collection) does not presize the allocation of a collection PERFORMANCE PSC_PRESIZE_COLLECTIONS 134 Medium

org.carrot2.labs.smartsprites.message.LevelCounterMessageSink

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.message.LevelCounterMessageSink.add(Message) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 54 Medium
Method org.carrot2.labs.smartsprites.message.LevelCounterMessageSink.add(Message) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 58 Medium

org.carrot2.labs.smartsprites.message.Message

Bug Category Details Line Priority
Method org.carrot2.labs.smartsprites.message.Message.toString() passes constant String of length 1 to character overridden method PERFORMANCE UCPM_USE_CHARACTER_PARAMETERIZED_METHOD 421 Medium

org.carrot2.labs.smartsprites.message.PrintStreamMessageSink

Bug Category Details Line Priority
new org.carrot2.labs.smartsprites.message.PrintStreamMessageSink(PrintStream, Message$MessageLevel) may expose internal representation by storing an externally mutable object into PrintStreamMessageSink.printStream MALICIOUS_CODE EI_EXPOSE_REP2 75 Medium

org.carrot2.labs.smartsprites.resource.FileSystemResourceHandler

Bug Category Details Line Priority
new org.carrot2.labs.smartsprites.resource.FileSystemResourceHandler(String, String, MessageLog) may expose internal representation by storing an externally mutable object into FileSystemResourceHandler.messageLog MALICIOUS_CODE EI_EXPOSE_REP2 89 Medium
Constrained method org.carrot2.labs.smartsprites.resource.FileSystemResourceHandler.getResourceAsReader(String) converts checked exception to unchecked instead of another allowable checked exception STYLE EXS_EXCEPTION_SOFTENING_HAS_CHECKED 104 Medium
Constrained method org.carrot2.labs.smartsprites.resource.FileSystemResourceHandler.getResourceAsWriter(String) converts checked exception to unchecked instead of another allowable checked exception STYLE EXS_EXCEPTION_SOFTENING_HAS_CHECKED 124 Medium

org.carrot2.labs.test.Assertions

Bug Category Details Line Priority
Class org.carrot2.labs.test.Assertions has a circular dependency with other classes CORRECTNESS FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY 48-107 Medium
Class org.carrot2.labs.test.Assertions has a circular dependency with other classes CORRECTNESS FCCD_FIND_CLASS_CIRCULAR_DEPENDENCY 48-107 Medium

org.carrot2.labs.test.BufferedImageAssertion

Bug Category Details Line Priority
new org.carrot2.labs.test.BufferedImageAssertion(BufferedImage) may expose internal representation by storing an externally mutable object into BufferedImageAssertion.actual MALICIOUS_CODE EI_EXPOSE_REP2 65 Medium

org.carrot2.labs.test.CssPropertyListAssertion

Bug Category Details Line Priority
new org.carrot2.labs.test.CssPropertyListAssertion(List) may expose internal representation by storing an externally mutable object into CssPropertyListAssertion.actual MALICIOUS_CODE EI_EXPOSE_REP2 64 Medium

org.carrot2.labs.test.MessageListAssertion

Bug Category Details Line Priority
new org.carrot2.labs.test.MessageListAssertion(List) may expose internal representation by storing an externally mutable object into MessageListAssertion.actual MALICIOUS_CODE EI_EXPOSE_REP2 67 Medium
Method org.carrot2.labs.test.MessageListAssertion.doesNotHaveMessagesOfLevel(Message$MessageLevel) calls equals on an enum instance CORRECTNESS ENMI_EQUALS_ON_ENUM 183 Medium
Method org.carrot2.labs.test.MessageListAssertion.doesNotHaveMessagesOfLevel(Message$MessageLevel) concatenates the result of a toString() call CORRECTNESS ISB_TOSTRING_APPENDING 189 Medium

org.carrot2.util.CollectionUtils

Bug Category Details Line Priority
Method org.carrot2.util.CollectionUtils.toString(Collection) concatenates the result of a toString() call CORRECTNESS ISB_TOSTRING_APPENDING 64 Medium