Showing 244 of 412 total issues
File ChannelManager.java
has 1306 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2.channel;
import java.io.IOException;
import java.util.ArrayList;
File SFTPv3Client.java
has 763 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2;
import java.io.BufferedOutputStream;
import java.io.IOException;
Method handleMessage
has a Cognitive Complexity of 81 (exceeds 5 allowed). Consider refactoring. Open
public synchronized void handleMessage(byte[] msg, int msglen) throws IOException
{
PacketKexInit kip;
if (msg == 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
Method decode
has a Cognitive Complexity of 70 (exceeds 5 allowed). Consider refactoring. Open
public static KeyPair decode(PEMStructure ps, String password) throws IOException
{
if (isPEMEncrypted(ps) && ps.pemType != PEM_OPENSSH_PRIVATE_KEY)
{
if (password == 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
File KexManager.java
has 607 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2.transport;
import com.trilead.ssh2.signature.RSASHA256Verify;
import com.trilead.ssh2.signature.RSASHA512Verify;
File KnownHosts.java
has 601 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2;
import java.io.BufferedReader;
import java.io.CharArrayReader;
File Connection.java
has 561 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2;
import java.io.CharArrayWriter;
import java.io.File;
Method handleMessage
has 225 lines of code (exceeds 25 allowed). Consider refactoring. Open
public synchronized void handleMessage(byte[] msg, int msglen) throws IOException
{
PacketKexInit kip;
if (msg == null)
File PEMDecoder.java
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2.crypto;
import java.io.BufferedReader;
import java.io.CharArrayReader;
Method receiveLoop
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
public void receiveLoop() throws IOException
{
byte[] msg = new byte[35004];
while (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 decode
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static KeyPair decode(PEMStructure ps, String password) throws IOException
{
if (isPEMEncrypted(ps) && ps.pemType != PEM_OPENSSH_PRIVATE_KEY)
{
if (password == null)
Connection
has 53 methods (exceeds 20 allowed). Consider refactoring. Open
public class Connection implements AutoCloseable
{
/**
* The identifier presented to the SSH-2 server.
*/
File TransportManager.java
has 469 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2.transport;
import com.trilead.ssh2.ExtensionInfo;
import com.trilead.ssh2.packets.PacketExtInfo;
File AuthAgentForwardThread.java
has 456 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2007 Kenny Root, Jeffrey Sharkey
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Method pseudoRegex
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
private final boolean pseudoRegex(char[] pattern, int i, char[] match, int j)
{
/* This matching logic is equivalent to the one present in OpenSSH 4.1 */
while (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
File SCPClient.java
has 448 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
ChannelManager
has 46 methods (exceeds 20 allowed). Consider refactoring. Open
public class ChannelManager implements MessageHandler
{
private static final Logger log = Logger.getLogger(ChannelManager.class);
private final HashMap<String, X11ServerData> x11_magic_cookies = new HashMap<>();
File AuthenticationManager.java
has 418 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2.auth;
import com.trilead.ssh2.crypto.keys.Ed25519PrivateKey;
import com.trilead.ssh2.crypto.keys.Ed25519PublicKey;
Method hostnameMatches
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private final boolean hostnameMatches(String[] hostpatterns, String hostname)
{
boolean isMatch = false;
boolean negate = false;
- 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
File ECDSASHA2Verify.java
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* Copyright 2014 Kenny Root
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions