Showing 244 of 412 total issues
Method decodeSignature
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private byte[] decodeSignature(byte[] sig) throws IOException
{
byte[] rsArray = null;
if (sig.length == 40)
Method hostnameMatches
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private final boolean hostnameMatches(String[] hostpatterns, String hostname)
{
boolean isMatch = false;
boolean negate = false;
Method waitForCondition
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public int waitForCondition(Channel c, long timeout, int condition_mask)
{
long end_time = 0;
boolean end_time_set = false;
Method verifyHostkey
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public int verifyHostkey(String hostname, String serverHostKeyAlgorithm, byte[] serverHostKey) throws IOException
{
PublicKey remoteKey = null;
if (RSASHA1Verify.ID_SSH_RSA.equals(serverHostKeyAlgorithm) ||
Method receiveFiles
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void receiveFiles(Session sess, OutputStream[] targets) throws IOException
{
byte[] buffer = new byte[8192];
OutputStream os = new BufferedOutputStream(sess.getStdin(), 512);
Method receiveMessage
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public int receiveMessage(byte[] buffer, int off, int len) throws IOException
{
final int packetLength;
final int payloadLength;
Method scanDirectory
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private final Vector scanDirectory(byte[] handle) throws IOException
{
Vector files = new Vector();
while (true)
Method run
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void run()
{
byte[] buff = new byte[8192];
while (true)
Method removeDuplicates
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private String[] removeDuplicates(String[] list)
{
if ((list == null) || (list.length < 2))
return list;
- 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 read
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public int read(SFTPv3FileHandle handle, long fileOffset, byte[] dst, int dstoff, int len) throws IOException
{
checkHandleValidAndOpen(handle);
if ((len > 32768) || (len <= 0))
Method initialize
has 46 lines of code (exceeds 25 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 */
Method msgChannelOpenFailure
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void msgChannelOpenFailure(byte[] msg, int msglen) throws IOException
{
if (msglen < 5)
throw new IOException("SSH_MSG_CHANNEL_OPEN_FAILURE message has wrong size (" + msglen + ")");
Method addHostkey
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void addHostkey(String[] hostnames, String serverHostKeyAlgorithm, byte[] serverHostKey) throws IOException
{
if (hostnames == null)
throw new IllegalArgumentException("hostnames may not be null");
Method processSignRequest
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private void processSignRequest(TypesReader tr)
{
try
{
if (failWhenLocked())
- 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 read
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public int read(SFTPv3FileHandle handle, long fileOffset, byte[] dst, int dstoff, int len) throws IOException
{
checkHandleValidAndOpen(handle);
if ((len > 32768) || (len <= 0))
- 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 msgChannelOpen
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public void msgChannelOpen(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 verifyHostkey
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public int verifyHostkey(String hostname, String serverHostKeyAlgorithm, byte[] serverHostKey) throws IOException
{
PublicKey remoteKey = null;
if (RSASHA1Verify.ID_SSH_RSA.equals(serverHostKeyAlgorithm) ||
- 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 run
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public void run()
{
try
{
cm.registerThread(this);
- 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 run
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void run()
{
try
{
c.cm.sendOpenConfirmation(c);
Consider simplifying this complex logical expression. Open
if (tr.readByte() != 0x30 || // ASN.1 sequence
tr.readByte() != ENCODED_SIZE - 2 || // Expected size
tr.readByte() != 0x02 || // ASN.1 Integer
tr.readByte() != 1 || // length
tr.readByte() != 0 || // v1