Showing 7 of 86 total issues
Method checkColorThreshold
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private static Color checkColorThreshold(@NotNull final Color color) {
int averageRed = color.getRed();
int averageGreen = color.getGreen();
int averageBlue = color.getBlue();
long averageColor = averageRed + averageGreen + averageBlue;
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method resizeAndCrop
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static BufferedImage resizeAndCrop(final BufferedImage inputImage,
final int outputWidth, final int outputHeight) {
final double outputAspectRatio = outputWidth / (double) outputHeight;
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method saveWithSuccess
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Test
public void saveWithSuccess() throws URISyntaxException {
// arrange
final Event eventToCreate = Event.builder()
.eventId(0L)
- Create a ticketCreate a ticket
Method resizeAndCrop
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static BufferedImage resizeAndCrop(final BufferedImage inputImage,
final int outputWidth, final int outputHeight) {
final double outputAspectRatio = outputWidth / (double) outputHeight;
- Create a ticketCreate a ticket
Method searchForError
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private Error searchForError(@NotNull final Throwable cause) {
Error error = null;
if (cause instanceof ConcurrentModificationException) {
error = new Error(CONFLICT, cause);
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method crop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static BufferedImage crop(final BufferedImage inputImage,
final int startX, final int startY,
final int outputWidth, final int outputHeight) {
- Create a ticketCreate a ticket
Method requestChallenge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@GET
@Consumes({MediaType.WILDCARD})
public Response requestChallenge(@QueryParam("email") final String email) {
final Response response;
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"