Showing 226 of 360 total issues
Method generateKey
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public String generateKey(BigInteger privKey, BigInteger pubKey, int licenseType, int productId,
int minorVersion, int majorVersion, String userName) {
Method ablePassByHinder
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static boolean ablePassByHinder(Tank t) {
if (Objects.isNull(instance) || Objects.isNull(instance.hero) || !instance.hero.isAlive()) {
return true;
}
- Read upRead up
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 findBestPosition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void findBestPosition() {
int tempScore = 0;
bestX = effectiveX1;
bestY = effectiveY1;
for (int x = effectiveX1; x <= effectiveX2; x++) {
- Read upRead up
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 consumerScheduler
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static void consumerScheduler() throws InterruptedException {
Thread producer = new Thread(() -> {
AtomicInteger count = new AtomicInteger();
while (true) {
try {
- Read upRead up
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 initPool
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected void initPool() {
if (Objects.isNull(property) || !property.isAbleToInit()) {
return;
}
- Read upRead up
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
Avoid deeply nested control flow statements. Open
if (temps.get(k) != null) {
dat.add(temps.get(k));
}
Method sort
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public int[] sort(int[] data) {
int[] result = Arrays.copyOf(data, data.length);
List<Integer> temp = Arrays.stream(data).boxed().collect(Collectors.toList());
// 0 -> []. 1 -> [], ... 9 -> []
- Read upRead up
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 getI
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static int getI(char[] exChar, int i, StringBuilder sb) {
while (('a' <= exChar[i] && exChar[i] <= 'z') || ('A' <= exChar[i] && exChar[i] <= 'Z') || exChar[i] == '_' || ('0' <= exChar[i] && exChar[i] <= '9')) {
if (i == exChar.length - 1) {
sb.append(exChar[i]);
break;
- Read upRead up
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 scanEntry
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void scanEntry(String packagePath, Set<Class<?>> classes, Enumeration entries) {
if (!entries.hasMoreElements()) {
return;
}
- Read upRead up
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 generateKeyBytes
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private byte[] generateKeyBytes(int licenseType, int productId,
int minorVersion, int majorVersion,
String userName, int customerId) {
Method minAndMax
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static <T extends Comparable<T>> Pair<T> minAndMax(T[] list) {
if (list == null || list.length == 0) {
return null;
}
- Read upRead up
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
Consider simplifying this complex logical expression. Open
else if (listFiles || mlsd || mdtm || mlst || listNames || size) {
if (mlsd) {
for (final FTPFile f : ftp.mlistDir(remote)) {
System.out.println(f.getRawListing());
System.out.println(f.toFormattedString(displayTimeZoneId));
Consider simplifying this complex logical expression. Open
if (exChar[i] == '+' || exChar[i] == '-' || exChar[i] == '*' || exChar[i] == '/' || exChar[i] == '(' || exChar[i] == ')') {
StringBuilder sb = new StringBuilder();
sb.append(exChar[i]);
switch (exChar[i]) {
case '+':
Method createB
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public void createB(List<Brick> bricks, int startX, int startY, int endX, int endY) {
Method clientChannel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private static void clientChannel(WebSocketClientHandler handler, EventLoopGroup group, SslContext sslCtx,
String host, int port) throws InterruptedException {
Method createI
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public void createI(List<Iron> irons, int startX, int startY, int endX, int endY) {
Method decryptFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static void decryptFile(String algorithm, SecretKey key, IvParameterSpec iv,
File encryptedFile, File decryptedFile) throws IOException, NoSuchPaddingException,
Method encryptFile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static void encryptFile(String algorithm, SecretKey key, IvParameterSpec iv,
File inputFile, File outputFile) throws IOException, NoSuchPaddingException,
Method paint
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void paint(Graphics graphics) {
super.paint(graphics);
//draw border
- Read upRead up
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 channelRead0
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
Channel ch = ctx.channel();
if (!shaker.isHandshakeComplete()) {
try {
- Read upRead up
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"