Showing 244 of 412 total issues
Method run
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public void run()
{
try
{
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 DES.java
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2.crypto.cipher;
/*
* This file is based on the 3DES implementation from the Bouncy Castle Crypto package.
Method close
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void close(Throwable cause, boolean useDisconnectPacket)
{
if (!useDisconnectPacket)
{
/* OK, hard shutdown - do not aquire the semaphore,
Method run
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void run()
{
try
{
cm.registerThread(this);
Method msgChannelRequest
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public void msgChannelRequest(byte[] msg, int msglen) throws IOException
{
TypesReader tr = new TypesReader(msg, 0, msglen);
tr.readByte(); // skip packet type
- 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 connect
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public synchronized ConnectionInfo connect(ServerHostKeyVerifier verifier, int connectTimeout, int kexTimeout)
throws IOException
{
final class TimeoutState
{
- 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 receiveFiles
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void receiveFiles(Session sess, String[] files, String target) throws IOException
{
byte[] buffer = new byte[8192];
OutputStream os = new BufferedOutputStream(sess.getStdin(), 512);
KnownHosts
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
public class KnownHosts
{
public static final int HOSTKEY_IS_OK = 0;
public static final int HOSTKEY_IS_NEW = 1;
public static final int HOSTKEY_HAS_CHANGED = 2;
Method msgChannelRequest
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void msgChannelRequest(byte[] msg, int msglen) throws IOException
{
TypesReader tr = new TypesReader(msg, 0, msglen);
tr.readByte(); // skip packet type
Method readAttrs
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private SFTPv3FileAttributes readAttrs(TypesReader tr) throws IOException
{
/*
* uint32 flags
* uint64 size present only if flag SSH_FILEXFER_ATTR_SIZE
- 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 initialize
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex,
int connectTimeout, SecureRandom rnd, ProxyData proxyData) throws IOException
{
/* First, establish the TCP connection to the SSH-2 server */
- 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 sendFiles
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private void sendFiles(Session sess, String[] files, String[] remoteFiles, String mode) throws IOException
{
byte[] buffer = new byte[8192];
OutputStream os = new BufferedOutputStream(sess.getStdin(), 40000);
- 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 TransportConnection.java
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
package com.trilead.ssh2.transport;
import java.io.IOException;
import java.io.InputStream;
ECDSASHA2Verify
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
public abstract class ECDSASHA2Verify implements SSHSignature {
private static final Logger log = Logger.getLogger(ECDSASHA2Verify.class);
public static final String ECDSA_SHA2_PREFIX = "ecdsa-sha2-";
Method mergeKexParameters
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private NegotiatedParameters mergeKexParameters(KexParameters client, KexParameters server)
{
NegotiatedParameters np = new NegotiatedParameters();
try
Method sendFiles
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void sendFiles(Session sess, String[] files, String[] remoteFiles, String mode) throws IOException
{
byte[] buffer = new byte[8192];
OutputStream os = new BufferedOutputStream(sess.getStdin(), 40000);
Method sendData
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void sendData(Channel c, byte[] buffer, int pos, int len) throws IOException
{
while (len > 0)
{
int thislen = 0;
Method processSignRequest
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void processSignRequest(TypesReader tr)
{
try
{
if (failWhenLocked())
Consider simplifying this complex logical expression. Open
if (kxs.np.kex_algo.equals(Curve25519Exchange.NAME)
|| kxs.np.kex_algo.equals(Curve25519Exchange.ALT_NAME)
|| kxs.np.kex_algo.equals("ecdh-sha2-nistp521")
|| kxs.np.kex_algo.equals("ecdh-sha2-nistp384")
|| kxs.np.kex_algo.equals("ecdh-sha2-nistp256")
Consider simplifying this complex logical expression. Open
if (kxs.np.kex_algo.equals("diffie-hellman-group1-sha1")
|| kxs.np.kex_algo.equals("diffie-hellman-group14-sha1")
|| kxs.np.kex_algo.equals("diffie-hellman-group14-sha256")
|| kxs.np.kex_algo.equals("diffie-hellman-group16-sha512")
|| kxs.np.kex_algo.equals("diffie-hellman-group18-sha512")