connectbot/sshlib

View on GitHub

Showing 412 of 412 total issues

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

    private final void readBytes(byte[] buff, int pos, int len) throws IOException
    {
        while (len > 0)
        {
            int count = is.read(buff, pos, len);
Severity: Minor
Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static byte[] decode(PKCS8EncodedKeySpec keySpec) throws InvalidKeySpecException {
        byte[] encoded = keySpec.getEncoded();
        if (encoded.length != ENCODED_SIZE) {
            throw new InvalidKeySpecException("Key spec is of invalid size");
        }
Severity: Minor
Found in src/main/java/com/trilead/ssh2/crypto/keys/Ed25519PrivateKey.java - About 25 mins to fix

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 hexToInt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static int hexToInt(char c)
    {
        if ((c >= 'a') && (c <= 'f'))
        {
            return (c - 'a') + 10;
Severity: Minor
Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 25 mins to fix

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 onConnect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private void onConnect(Socks5Server server) throws IOException {
            final Channel cn;

            String destHost = server.getHostName();
            if (destHost == null) {
Severity: Minor
Found in src/main/java/com/trilead/ssh2/channel/DynamicAcceptThread.java - About 25 mins to fix

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 isPEMEncrypted has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final boolean isPEMEncrypted(PEMStructure ps) throws IOException
    {
        if (ps.pemType == PEM_OPENSSH_PRIVATE_KEY) {
            TypesReader tr = new TypesReader(ps.data);
            byte[] magic = tr.readBytes(OPENSSH_V1_MAGIC.length);
Severity: Minor
Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 25 mins to fix

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 decodePublicKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public PublicKey decodePublicKey(byte[] key) throws IOException {
        TypesReader tr = new TypesReader(key);

        String key_format = tr.readString();
Severity: Minor
Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java - About 25 mins to fix

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 decodeSSHECDSASignature has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private byte[] decodeSSHECDSASignature(byte[] sig) throws IOException {
        byte[] rsArray;

        TypesReader tr = new TypesReader(sig);

Severity: Minor
Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java - About 25 mins to fix

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

Expected an indentation at 4 instead of at 2.
Open

  Department of Computer Science (http://www.inf.ethz.ch),
Severity: Minor
Found in LICENSE.txt by editorconfig

Expected an indentation at 4 instead of at 2.
Open

  Christian Plattner. All rights reserved.
Severity: Minor
Found in LICENSE.txt by editorconfig

Expected a newline at the end of the file.
Open

}

Expected a newline at the end of the file.
Open

}

Unexpected additional newlines at the end of the file.
Open

Severity
Category
Status
Source
Language