connectbot/sshlib

View on GitHub
src/main/java/com/trilead/ssh2/SFTPv3Client.java

Summary

Maintainability
F
1 wk
Test Coverage
F
0%

File SFTPv3Client.java has 763 lines of code (exceeds 250 allowed). Consider refactoring.
Open


package com.trilead.ssh2;

import java.io.BufferedOutputStream;
import java.io.IOException;
Severity: Major
Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 day to fix

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

          private byte[] createAttrs(SFTPv3FileAttributes attr)
          {
              TypesWriter tw = new TypesWriter();
      
              int attrFlags = 0;
      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 readAttrs has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          private SFTPv3FileAttributes readAttrs(TypesReader tr) throws IOException
          {
              /*
               * uint32   flags
               * uint64   size           present only if flag SSH_FILEXFER_ATTR_SIZE
      Severity: Minor
      Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 2 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 48 lines of code (exceeds 25 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 1 hr to fix

        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))
        Severity: Minor
        Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

          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))
          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 readAttrs has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private SFTPv3FileAttributes readAttrs(TypesReader tr) throws IOException
              {
                  /*
                   * uint32   flags
                   * uint64   size           present only if flag SSH_FILEXFER_ATTR_SIZE
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

            Method write has 34 lines of code (exceeds 25 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

              Method createAttrs has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private byte[] createAttrs(SFTPv3FileAttributes attr)
                  {
                      TypesWriter tw = new TypesWriter();
              
                      int attrFlags = 0;
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

                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 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 openDirectory has 30 lines of code (exceeds 25 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 1 hr to fix

                        Method fstat has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public SFTPv3FileAttributes fstat(SFTPv3FileHandle handle) throws IOException
                            {
                                checkHandleValidAndOpen(handle);
                        
                                int req_id = generateNextRequestID();
                        Severity: Minor
                        Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

                          Method statBoth has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private SFTPv3FileAttributes statBoth(String path, int statMethod) 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 init has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private void init() throws IOException
                                {
                                    /* Send SSH_FXP_INIT (version 3) */
                            
                                    final int client_version = 3;
                            Severity: Minor
                            Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 1 hr to fix

                              Method init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private void init() throws IOException
                                  {
                                      /* Send SSH_FXP_INIT (version 3) */
                              
                                      final int client_version = 3;
                              Severity: Minor
                              Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 45 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 sendMessage has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  private final void sendMessage(int type, int requestId, byte[] msg, int off, int len) throws IOException
                              Severity: Minor
                              Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 35 mins to fix

                                Method read has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public int read(SFTPv3FileHandle handle, long fileOffset, byte[] dst, int dstoff, int len) throws IOException
                                Severity: Minor
                                Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 35 mins to fix

                                  Method write has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public void write(SFTPv3FileHandle handle, long fileOffset, byte[] src, int srcoff, int len) throws IOException
                                  Severity: Minor
                                  Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java - About 35 mins to fix

                                    Method readLink has a Cognitive Complexity of 7 (exceeds 5 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 35 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 canonicalPath has a Cognitive Complexity of 7 (exceeds 5 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 35 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 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 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

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        public String canonicalPath(String path) throws IOException
                                        {
                                            int req_id = generateNextRequestID();
                                    
                                            TypesWriter tw = new TypesWriter();
                                    Severity: Major
                                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 3 hrs to fix
                                    src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 482..529

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 234.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        public String readLink(String path) throws IOException
                                        {
                                            int req_id = generateNextRequestID();
                                    
                                            TypesWriter tw = new TypesWriter();
                                    Severity: Major
                                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 3 hrs to fix
                                    src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 658..705

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 234.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                if ((attr.atime != null) && (attr.mtime != null))
                                                {
                                                    tw.writeUINT32(attr.atime.intValue());
                                                    tw.writeUINT32(attr.mtime.intValue());
                                                }
                                    Severity: Minor
                                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 40 mins to fix
                                    src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 1140..1144

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 50.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Identical blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                if ((attr.uid != null) && (attr.gid != null))
                                                {
                                                    tw.writeUINT32(attr.uid.intValue());
                                                    tw.writeUINT32(attr.gid.intValue());
                                                }
                                    Severity: Minor
                                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 40 mins to fix
                                    src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 1149..1153

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 50.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        public void rm(String fileName) throws IOException
                                        {
                                            int req_id = generateNextRequestID();
                                    
                                            TypesWriter tw = new TypesWriter();
                                    Severity: Minor
                                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 40 mins to fix
                                    src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 984..994

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 50.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                        public void rmdir(String dirName) throws IOException
                                        {
                                            int req_id = generateNextRequestID();
                                    
                                            TypesWriter tw = new TypesWriter();
                                    Severity: Minor
                                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 40 mins to fix
                                    src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 966..976

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 50.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if ((flags & AttribFlags.SSH_FILEXFER_ATTR_PERMISSIONS) != 0)
                                            {
                                                if (debug != null)
                                                    debug.println("SSH_FILEXFER_ATTR_PERMISSIONS");
                                                fa.permissions = new Integer(tr.readUINT32());
                                    Severity: Minor
                                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 40 mins to fix
                                    src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 297..302

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 48.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                            if ((flags & AttribFlags.SSH_FILEXFER_ATTR_SIZE) != 0)
                                            {
                                                if (debug != null)
                                                    debug.println("SSH_FILEXFER_ATTR_SIZE");
                                                fa.size = new Long(tr.readUINT64());
                                    Severity: Minor
                                    Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 40 mins to fix
                                    src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 312..317

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 48.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    There are no issues that match your filters.

                                    Category
                                    Status