connectbot/sshlib

View on GitHub

Showing 244 of 412 total issues

SFTPv3Client has 42 methods (exceeds 20 allowed). Consider refactoring.
Open

public class SFTPv3Client
{
    final Connection conn;
    final Session sess;
    final PrintStream debug;
Severity: Minor
Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 5 hrs to fix

    Method authenticatePublicKey has 136 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public boolean authenticatePublicKey(String user, KeyPair pair, SecureRandom rnd, SignatureProxy signatureProxy)
                throws IOException
        {
            PrivateKey privateKey = null;
            PublicKey publicKey = null;
    Severity: Major
    Found in src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java - About 5 hrs to fix

      Method authenticatePublicKey has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
      Open

          public boolean authenticatePublicKey(String user, KeyPair pair, SecureRandom rnd, SignatureProxy signatureProxy)
                  throws IOException
          {
              PrivateKey privateKey = null;
              PublicKey publicKey = null;
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/auth/AuthenticationManager.java - About 5 hrs 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 run has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
      Open

          public void run()
          {
              try
              {
                  /* Send Open Confirmation */
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/channel/RemoteX11AcceptThread.java - About 4 hrs 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 run has 111 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void run()
          {
              try
              {
                  /* Send Open Confirmation */
      Severity: Major
      Found in src/main/java/com/trilead/ssh2/channel/RemoteX11AcceptThread.java - About 4 hrs to fix

        Method close has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public void close(Throwable cause, boolean useDisconnectPacket)
            {
                if (!useDisconnectPacket)
                {
                    /* OK, hard shutdown - do not aquire the semaphore,
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 4 hrs 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 getChannelData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public int getChannelData(Channel c, boolean extended, byte[] target, int off, int len) throws IOException
            {
                int copylen = 0;
                int increment = 0;
                int remoteID = 0;
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 4 hrs 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 waitForCondition has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

            public int waitForCondition(Channel c, long timeout, int condition_mask)
            {
                long end_time = 0;
                boolean end_time_set = false;
        
        
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 4 hrs 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 parsePEM has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
        Open

            public static final PEMStructure parsePEM(char[] pem) throws IOException
            {
                PEMStructure ps = new PEMStructure();
        
                String line = null;
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 4 hrs 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 28 (exceeds 5 allowed). Consider refactoring.
        Open

            public static byte[] decode(char[] message) throws IOException
            {
                byte buff[] = new byte[4];
                byte dest[] = new byte[message.length];
        
        
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/crypto/Base64.java - About 4 hrs 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 addIdentity has 101 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void addIdentity(TypesReader tr, boolean checkConstraints) {
                try
                {
                    if (failWhenLocked())
                        return;
        Severity: Major
        Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.java - About 4 hrs to fix

          Method run has 96 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public void run()
              {
                  try
                  {
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.java - About 3 hrs to fix

            Method generateWorkingKey has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

                protected int[] generateWorkingKey(boolean encrypting, byte[] key, int off)
                {
                    int[] newKey = new int[32];
                    boolean[] pc1m = new boolean[56], pcr = new boolean[56];
            
            
            Severity: Minor
            Found in src/main/java/com/trilead/ssh2/crypto/cipher/DES.java - About 3 hrs 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 receiveFiles has a Cognitive Complexity of 26 (exceeds 5 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);
            Severity: Minor
            Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 3 hrs 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 receiveLoop has 87 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void receiveLoop() throws IOException
                {
                    byte[] msg = new byte[35004];
            
                    while (true)
            Severity: Major
            Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 3 hrs to fix

              Method sendMessage has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void sendMessage(byte[] message, int off, int len, int padd) throws IOException
                  {
                      if (padd < 4)
                          padd = 4;
                      else if (padd > 64)
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/transport/TransportConnection.java - About 3 hrs 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 addIdentity has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                  private void addIdentity(TypesReader tr, boolean checkConstraints) {
                      try
                      {
                          if (failWhenLocked())
                              return;
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/channel/AuthAgentForwardThread.java - About 3 hrs 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 receiveFiles has a Cognitive Complexity of 24 (exceeds 5 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);
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 3 hrs 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 scanDirectory has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  private final Vector scanDirectory(byte[] handle) throws IOException
                  {
                      Vector files = new Vector();
              
                      while (true)
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 3 hrs 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 sendData has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void sendData(Channel c, byte[] buffer, int pos, int len) throws IOException
                  {
                      while (len > 0)
                      {
                          int thislen = 0;
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 3 hrs 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