This repo hasn't had a successful analysis for its default branch yet.

clormor/hacker-rank-java

View on GitHub

Showing 13 of 13 total issues

Method processNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

private void processNode(TreeNode parent, int parentId) {
for (Integer childId : allEdges.get(parentId)) {
allEdges.get(childId).remove(parentId);
Tree child;
Set<Integer> grandChildren = allEdges.get(childId);

Method locateTarget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

@VisibleForTesting
Position locateTarget(int n, char[][] matrix, char target) {
for (int x = 0; x < n; x++) {
for (int y = 0; y < n; y++) {
if (matrix[y][x] == target) {
Severity: Minor
Found in src/main/java/io/github/clormor/hackerrank/ai/BotSavesPrincess.java - About 25 mins to fix

Extra separation in import group before 'java.lang.reflect.Method'
Open

import java.lang.reflect.Method;

Define and throw a dedicated exception instead of using a generic one.
Open

throw new RuntimeException(e);

Replace this call to "replaceAll()" by a call to the "replace()" method.
Open

return result.toString().replaceAll("\\$jacocoInit\\n", "");

Refactor this repetition that can lead to a stack overflow for large inputs.
Open

"((?<!\\w)\\w+)(\\s+\\1(?!\\w))+",

Define and throw a dedicated exception instead of using a generic one.
Open

if (n == 0 && p == 0) throw new Exception(ZERO_ERROR);

Change the visibility of this constructor to "protected".
Open

public Tree(int value, Color color, int depth) {

Define and throw a dedicated exception instead of using a generic one.
Open

throw new RuntimeException("Target (" + target + ") is missing!");

Define and throw a dedicated exception instead of using a generic one.
Open

throw new RuntimeException("Invalid command " + parts[0]);

Define and throw a dedicated exception instead of using a generic one.
Open

public long power(int n, int p) throws Exception {

Define and throw a dedicated exception instead of using a generic one.
Open

if (n < 0 || p < 0) throw new Exception(NEGATIVE_ERROR);

Change the visibility of this constructor to "protected".
Open

public AbstractHashingExample(String algorithm) {
Severity
Category
Status
Source
Language