connectbot/sshlib

View on GitHub

Showing 244 of 412 total issues

Method get has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private void get(String remoteFiles[], OutputStream[] targets) throws IOException
    {
        Session sess = null;

        if ((remoteFiles == null) || (targets == null))
Severity: Minor
Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 1 hr to fix

    Method create has 10 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static KeyMaterial create(String hashAlgo, byte[] H, BigInteger K, byte[] SessionID, int keyLengthCS,
                int blockSizeCS, int macLengthCS, int keyLengthSC, int blockSizeSC, int macLengthSC)
    Severity: Major
    Found in src/main/java/com/trilead/ssh2/crypto/KeyMaterial.java - About 1 hr to fix

      Method run has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

              public void run()
              {
                  while (true)
                  {
                      byte[] msg;
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 1 hr 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 readLineRN has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public final static int readLineRN(InputStream is, byte[] buffer) throws IOException
          {
              int pos = 0;
              boolean need10 = false;
              int len = 0;
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/transport/ClientServerHello.java - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
      Open

              public void run()
              {
                  synchronized (todolist)
                  {
                      while (true)
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/util/TimeoutService.java - About 1 hr 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 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public void run()
          {
              try
              {
                  c.cm.sendOpenConfirmation(c);
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/channel/RemoteAcceptThread.java - About 1 hr 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 write has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public void write(SFTPv3FileHandle handle, long fileOffset, byte[] src, int srcoff, int len) throws IOException
          {
              checkHandleValidAndOpen(handle);
      
              while (len > 0)
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr 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 parseTokens has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static String[] parseTokens(String source, char delimiter)
          {
              if (source.length() == 0)
                  return new String[0];
      
      
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/util/Tokenizer.java - About 1 hr 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 addHostkeyToFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public final static void addHostkeyToFile(File knownHosts, String[] hostnames, String serverHostKeyAlgorithm,
                  byte[] serverHostKey) throws IOException
          {
              if ((hostnames == null) || (hostnames.length == 0))
                  throw new IllegalArgumentException("Need at least one hostname specification");
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 1 hr 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 rawFingerPrint has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          private static byte[] rawFingerPrint(String type, String keyType, byte[] hostkey)
          {
              MessageDigest dig = null;
      
              try {
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 1 hr 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 recommendHostkeyAlgorithms has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          private String[] recommendHostkeyAlgorithms(String hostname) {
              List<String> preferredAlgos = new ArrayList<>();
      
              List<PublicKey> keys = getAllKeys(hostname);
      
      
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/KnownHosts.java - About 1 hr 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 get has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          private void get(String remoteFiles[], OutputStream[] targets) throws IOException
          {
              Session sess = null;
      
              if ((remoteFiles == null) || (targets == null))
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/SCPClient.java - About 1 hr 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 readOid has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public String readOid() throws IOException
          {
              int type = readByte() & 0xff;
      
              if (type != 0x06)
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/crypto/SimpleDERReader.java - About 1 hr to fix

        Method openFile has 31 lines of code (exceeds 25 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 1 hr to fix

          Method readLink has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public String readLink(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 1 hr to fix

            Method canonicalPath has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public String canonicalPath(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 1 hr to fix

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

                      public void run()
                      {
                          while (true)
                          {
                              byte[] msg;
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 1 hr to fix

                Method unRegisterX11Cookie has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void unRegisterX11Cookie(String hexFakeCookie, boolean killChannels)
                    {
                        if (hexFakeCookie == null)
                            throw new IllegalStateException("hexFakeCookie may not be null");
                
                
                Severity: Minor
                Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

                  Method read has 30 lines of code (exceeds 25 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/StreamGobbler.java - About 1 hr to fix

                    Method sendMessage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public void sendMessage(byte[] msg) throws IOException
                        {
                            if (Thread.currentThread() == receiveThread)
                                throw new IOException("Assertion error: sendMessage may never be invoked by the receiver thread!");
                    
                    
                    Severity: Minor
                    Found in src/main/java/com/trilead/ssh2/transport/TransportManager.java - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language