connectbot/sshlib

View on GitHub

Showing 244 of 412 total issues

Avoid too many return statements within this method.
Open

            return;
Severity: Major
Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return true;
    Severity: Major
    Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return false;
      Severity: Major
      Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return false;
        Severity: Major
        Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return ECDSASHA2NISTP256Verify.get();
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return false;
            Severity: Major
            Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                      return true;
              Severity: Major
              Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 30 mins to fix

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

                    private final byte[] openDirectory(String path) throws IOException
                    {
                        int req_id = generateNextRequestID();
                
                        TypesWriter tw = new TypesWriter();
                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 openFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private SFTPv3FileHandle openFile(String fileName, int flags, SFTPv3FileAttributes attr) throws IOException
                    {
                        int req_id = generateNextRequestID();
                
                        TypesWriter tw = new TypesWriter();
                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 removeIdentity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void removeIdentity(TypesReader tr) {
                        try
                        {
                            if (failWhenLocked())
                                return;
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.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 init has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    @Override
                    public void init(String name) throws IOException {
                        final ECParameterSpec spec;
                
                        if ("ecdh-sha2-nistp256".equals(name)) {
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.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 read has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public int read(byte[] b, int off, int len) throws IOException
                    {
                        if (b == null)
                            throw new NullPointerException();
                
                
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/channel/ChannelInputStream.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 removeAllIdentities has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void removeAllIdentities(TypesReader tr) {
                        try
                        {
                            if (failWhenLocked())
                                return;
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.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 waitUntilChannelOpen has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void waitUntilChannelOpen(Channel c) throws IOException
                    {
                        synchronized (c)
                        {
                            while (c.state == Channel.STATE_OPENING)
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 compareFirstOfNameList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private boolean compareFirstOfNameList(String[] a, String[] b)
                    {
                        if (a == null || b == null)
                            throw new IllegalArgumentException();
                
                
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/transport/KexManager.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(byte[] input) throws InvalidKeySpecException {
                        if (input.length != ENCODED_SIZE) {
                            throw new InvalidKeySpecException("Key is not of correct size");
                        }
                
                
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/crypto/keys/Ed25519PublicKey.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 setKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    private void setKey(byte[] key)
                    {
                        /*
                         * - comments are from _Applied Crypto_, Schneier, p338 please be
                         * careful comparing the two, AC numbers the arrays from 1, the enclosed
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/crypto/cipher/BlowFish.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 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

                Severity
                Category
                Status
                Source
                Language