connectbot/sshlib

View on GitHub
src/main/java/com/trilead/ssh2/channel/ChannelManager.java

Summary

Maintainability
F
1 wk
Test Coverage
F
19%

File ChannelManager.java has 1306 lines of code (exceeds 250 allowed). Consider refactoring.
Open


package com.trilead.ssh2.channel;

import java.io.IOException;
import java.util.ArrayList;
Severity: Major
Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 3 days to fix

    ChannelManager has 46 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class ChannelManager implements MessageHandler
    {
        private static final Logger log = Logger.getLogger(ChannelManager.class);
    
        private final HashMap<String, X11ServerData> x11_magic_cookies = new HashMap<>();
    Severity: Minor
    Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 6 hrs to fix

      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 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

      Method handleMessage has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void handleMessage(byte[] msg, int msglen) throws IOException
          {
              if (msg == null)
              {
                  if (log.isEnabled())
      Severity: Major
      Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 3 hrs to fix

        Method getChannelData has 79 lines of code (exceeds 25 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: Major
        Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 3 hrs to fix

          Method msgChannelOpen has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void msgChannelOpen(byte[] msg, int msglen) throws IOException
              {
                  TypesReader tr = new TypesReader(msg, 0, msglen);
          
                  tr.readByte(); // skip packet type
          Severity: Major
          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 3 hrs to fix

            Method msgChannelRequest has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
            Open

                public void msgChannelRequest(byte[] msg, int msglen) throws IOException
                {
                    TypesReader tr = new TypesReader(msg, 0, msglen);
            
                    tr.readByte(); // skip packet type
            Severity: Minor
            Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 msgChannelRequest has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void msgChannelRequest(byte[] msg, int msglen) throws IOException
                {
                    TypesReader tr = new TypesReader(msg, 0, msglen);
            
                    tr.readByte(); // skip packet type
            Severity: Major
            Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 2 hrs to fix

              Method sendData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public void sendData(Channel c, byte[] buffer, int pos, int len) throws IOException
                  {
                      while (len > 0)
                      {
                          int thislen = 0;
              Severity: Major
              Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 2 hrs to fix

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

                  Method msgChannelOpenFailure has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public void msgChannelOpenFailure(byte[] msg, int msglen) throws IOException
                      {
                          if (msglen < 5)
                              throw new IOException("SSH_MSG_CHANNEL_OPEN_FAILURE message has wrong size (" + msglen + ")");
                  
                  
                  Severity: Minor
                  Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

                    Method msgChannelOpen has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void msgChannelOpen(byte[] msg, int msglen) throws IOException
                        {
                            TypesReader tr = new TypesReader(msg, 0, msglen);
                    
                            tr.readByte(); // skip packet type
                    Severity: Minor
                    Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 waitForChannelRequestResult has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private boolean waitForChannelRequestResult(Channel c) throws IOException
                        {
                            synchronized (c)
                            {
                                while ((c.successCounter == 0) && (c.failedCounter == 0))
                    Severity: Minor
                    Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 requestGlobalForward has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public int requestGlobalForward(String bindAddress, int bindPort, String targetAddress, int targetPort)
                                throws IOException
                        {
                            RemoteForwardingData rfd = new RemoteForwardingData();
                    
                    
                    Severity: Minor
                    Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 msgChannelExtendedData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public void msgChannelExtendedData(byte[] msg, int msglen) throws IOException
                            {
                                if (msglen <= 13)
                                    throw new IOException("SSH_MSG_CHANNEL_EXTENDED_DATA message has wrong size (" + msglen + ")");
                        
                        
                        Severity: Minor
                        Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

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

                              public void requestCancelGlobalForward(int bindPort) throws IOException
                              {
                                  RemoteForwardingData rfd = null;
                          
                                  synchronized (remoteForwardings)
                          Severity: Minor
                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

                            Method waitForGlobalRequestResult has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private boolean waitForGlobalRequestResult() throws IOException
                                {
                                    synchronized (channels)
                                    {
                                        while ((globalSuccessCounter == 0) && (globalFailedCounter == 0))
                            Severity: Minor
                            Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 waitForChannelRequestResult has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private boolean waitForChannelRequestResult(Channel c) throws IOException
                                {
                                    synchronized (c)
                                    {
                                        while ((c.successCounter == 0) && (c.failedCounter == 0))
                            Severity: Minor
                            Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

                              Method requestX11 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public void requestX11(Channel c, boolean singleConnection, String x11AuthenticationProtocol,
                                          String x11AuthenticationCookie, int x11ScreenNumber) throws IOException
                                  {
                                      PacketSessionX11Request psr;
                              
                              
                              Severity: Minor
                              Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 1 hr to fix

                                Method requestPTY has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    public void requestPTY(Channel c, String term, int term_width_characters, int term_height_characters,
                                            int term_width_pixels, int term_height_pixels, byte[] terminal_modes) throws IOException
                                Severity: Major
                                Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 50 mins to fix

                                  Method unRegisterX11Cookie has a Cognitive Complexity of 8 (exceeds 5 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 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 handleMessage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public void handleMessage(byte[] msg, int msglen) throws IOException
                                      {
                                          if (msg == null)
                                          {
                                              if (log.isEnabled())
                                  Severity: Minor
                                  Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 msgChannelExtendedData has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public void msgChannelExtendedData(byte[] msg, int msglen) throws IOException
                                      {
                                          if (msglen <= 13)
                                              throw new IOException("SSH_MSG_CHANNEL_EXTENDED_DATA message has wrong size (" + msglen + ")");
                                  
                                  
                                  Severity: Minor
                                  Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 msgChannelOpenFailure has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public void msgChannelOpenFailure(byte[] msg, int msglen) throws IOException
                                      {
                                          if (msglen < 5)
                                              throw new IOException("SSH_MSG_CHANNEL_OPEN_FAILURE message has wrong size (" + msglen + ")");
                                  
                                  
                                  Severity: Minor
                                  Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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 requestX11 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public void requestX11(Channel c, boolean singleConnection, String x11AuthenticationProtocol,
                                              String x11AuthenticationCookie, int x11ScreenNumber) throws IOException
                                  Severity: Minor
                                  Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 35 mins to fix

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

                                        public int getChannelData(Channel c, boolean extended, byte[] target, int off, int len) throws IOException
                                    Severity: Minor
                                    Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 35 mins to fix

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

                                          public void resizePTY(Channel c, int term_width_characters, int term_height_characters,
                                                  int term_width_pixels, int term_height_pixels) throws IOException {
                                      Severity: Minor
                                      Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java - About 35 mins to fix

                                        Method msgChannelData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public void msgChannelData(byte[] msg, int msglen) throws IOException
                                            {
                                                if (msglen <= 9)
                                                    throw new IOException("SSH_MSG_CHANNEL_DATA message has wrong size (" + msglen + ")");
                                        
                                        
                                        Severity: Minor
                                        Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.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

                                        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

                                          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

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

                                              public void msgChannelSuccess(byte[] msg, int msglen) throws IOException
                                              {
                                                  if (msglen != 5)
                                                      throw new IOException("SSH_MSG_CHANNEL_SUCCESS message has wrong size (" + msglen + ")");
                                          
                                          
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 2 hrs to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1499..1519

                                          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 177.

                                          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 msgChannelFailure(byte[] msg, int msglen) throws IOException
                                              {
                                                  if (msglen != 5)
                                                      throw new IOException("SSH_MSG_CHANNEL_FAILURE message has wrong size (" + msglen + ")");
                                          
                                          
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 2 hrs to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1477..1497

                                          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 177.

                                          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

                                                      {
                                                          copylen = (stdoutAvail > len) ? len : stdoutAvail;
                                                          System.arraycopy(c.stdoutBuffer, c.stdoutReadpos, target, off, copylen);
                                                          c.stdoutReadpos += copylen;
                                          
                                          
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 1 hr to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1070..1082

                                          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 116.

                                          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

                                                      {
                                                          copylen = (stderrAvail > len) ? len : stderrAvail;
                                                          System.arraycopy(c.stderrBuffer, c.stderrReadpos, target, off, copylen);
                                                          c.stderrReadpos += copylen;
                                          
                                          
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 1 hr to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1056..1068

                                          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 116.

                                          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

                                                  synchronized (c)
                                                  {
                                                      if (c.state == Channel.STATE_CLOSED)
                                                          return; // ignore
                                          
                                          
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 1 hr to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1153..1170

                                          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 110.

                                          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

                                                  synchronized (c)
                                                  {
                                                      if (c.state == Channel.STATE_CLOSED)
                                                          return; // ignore
                                          
                                          
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 1 hr to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 899..917

                                          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 110.

                                          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 3 locations. Consider refactoring.
                                          Open

                                                  for (int i = 0; i < descriptionBuffer.length(); i++)
                                                  {
                                                      char cc = descriptionBuffer.charAt(i);
                                          
                                                      if ((cc >= 32) && (cc <= 126))
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 2 other locations - About 55 mins to fix
                                          src/main/java/com/trilead/ssh2/transport/TransportManager.java on lines 569..576
                                          src/main/java/com/trilead/ssh2/transport/TransportManager.java on lines 614..621

                                          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 66.

                                          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

                                                  synchronized (c)
                                                  {
                                                      if (c.state != Channel.STATE_OPEN)
                                                          throw new IOException("Cannot request subsystem on this channel (" + c.getReasonClosed() + ")");
                                          
                                          
                                          Severity: Minor
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 55 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 812..820

                                          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 66.

                                          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

                                                  synchronized (c)
                                                  {
                                                      if (c.state != Channel.STATE_OPEN)
                                                          throw new IOException("Cannot execute command on this channel (" + c.getReasonClosed() + ")");
                                          
                                          
                                          Severity: Minor
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 55 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 780..788

                                          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 66.

                                          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 3 locations. Consider refactoring.
                                          Open

                                                      synchronized (c)
                                                      {
                                                          c.remoteID = remoteID;
                                                          c.remoteWindow = remoteWindow & 0xFFFFffffL; /* convert UINT32 to long */
                                                          c.remoteMaxPacketSize = remoteMaxPacketSize;
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 2 other locations - About 40 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1239..1245
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1314..1320

                                          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 52.

                                          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 3 locations. Consider refactoring.
                                          Open

                                                      synchronized (c)
                                                      {
                                                          c.remoteID = remoteID;
                                                          c.remoteWindow = remoteWindow & 0xFFFFffffL; /* properly convert UINT32 to long */
                                                          c.remoteMaxPacketSize = remoteMaxPacketSize;
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 2 other locations - About 40 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1239..1245
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1290..1296

                                          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 52.

                                          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 3 locations. Consider refactoring.
                                          Open

                                                      synchronized (c)
                                                      {
                                                          c.remoteID = remoteID;
                                                          c.remoteWindow = remoteWindow & 0xFFFFffffL; /* properly convert UINT32 to long */
                                                          c.remoteMaxPacketSize = remoteMaxPacketSize;
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 2 other locations - About 40 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1290..1296
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1314..1320

                                          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 52.

                                          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

                                                          {
                                                              PacketChannelOpenFailure pcof = new PacketChannelOpenFailure(remoteID,
                                                                      Packets.SSH_OPEN_ADMINISTRATIVELY_PROHIBITED, "X11 forwarding not activated", "");
                                          
                                                              tm.sendAsynchronousMessage(pcof.getPayload());
                                          Severity: Minor
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 40 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1273..1286

                                          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

                                                      {
                                                          PacketChannelOpenFailure pcof = new PacketChannelOpenFailure(remoteID,
                                                                  Packets.SSH_OPEN_ADMINISTRATIVELY_PROHIBITED,
                                                                  "No thanks, unknown port in forwarded-tcpip request", "");
                                          
                                          
                                          Severity: Minor
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 40 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1221..1231

                                          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 (len != (msglen - 9))
                                                      throw new IOException("SSH_MSG_CHANNEL_DATA message has wrong len (calculated " + (msglen - 9) + ", got "
                                                              + len + ")");
                                          Severity: Minor
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 892..894

                                          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 42.

                                          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 (len != (msglen - 13))
                                                      throw new IOException("SSH_MSG_CHANNEL_EXTENDED_DATA message has wrong len (calculated " + (msglen - 13)
                                                              + ", got " + len + ")");
                                          Severity: Minor
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 1 other location - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 1146..1148

                                          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 42.

                                          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 7 locations. Consider refactoring.
                                          Open

                                                  synchronized (c.channelSendLock)
                                                  {
                                                      if (c.closeMessageSent)
                                                          throw new IOException("Cannot request PTY on this channel (" + c.getReasonClosed() + ")");
                                                      tm.sendMessage(spr.getPayload());
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 6 other locations - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 661..666
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 730..735
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 755..760
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 790..795
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 822..827
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 857..862

                                          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 40.

                                          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 7 locations. Consider refactoring.
                                          Open

                                                  synchronized (c.channelSendLock)
                                                  {
                                                      if (c.closeMessageSent)
                                                          throw new IOException("Cannot request subsystem on this channel (" + c.getReasonClosed() + ")");
                                                      tm.sendMessage(ssr.getPayload());
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 6 other locations - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 661..666
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 697..702
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 730..735
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 755..760
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 822..827
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 857..862

                                          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 40.

                                          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 7 locations. Consider refactoring.
                                          Open

                                                  synchronized (c.channelSendLock)
                                                  {
                                                      if (c.closeMessageSent)
                                                          throw new IOException("Cannot ping this channel (" + c.getReasonClosed() + ")");
                                                      tm.sendMessage(pctp.getPayload());
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 6 other locations - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 697..702
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 730..735
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 755..760
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 790..795
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 822..827
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 857..862

                                          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 40.

                                          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 7 locations. Consider refactoring.
                                          Open

                                                  synchronized (c.channelSendLock)
                                                  {
                                                      if (c.closeMessageSent)
                                                          throw new IOException("Cannot execute command on this channel (" + c.getReasonClosed() + ")");
                                                      tm.sendMessage(sm.getPayload());
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 6 other locations - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 661..666
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 697..702
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 730..735
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 755..760
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 790..795
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 857..862

                                          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 40.

                                          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 7 locations. Consider refactoring.
                                          Open

                                                  synchronized (c.channelSendLock) {
                                                      if (c.closeMessageSent)
                                                          throw new IOException("Cannot request PTY on this channel ("
                                                                  + c.getReasonClosed() + ")");
                                                      tm.sendMessage(spr.getPayload());
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 6 other locations - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 661..666
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 697..702
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 755..760
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 790..795
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 822..827
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 857..862

                                          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 40.

                                          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 7 locations. Consider refactoring.
                                          Open

                                                  synchronized (c.channelSendLock)
                                                  {
                                                      if (c.closeMessageSent)
                                                          throw new IOException("Cannot start shell on this channel (" + c.getReasonClosed() + ")");
                                                      tm.sendMessage(sm.getPayload());
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 6 other locations - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 661..666
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 697..702
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 730..735
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 755..760
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 790..795
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 822..827

                                          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 40.

                                          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 7 locations. Consider refactoring.
                                          Open

                                                  synchronized (c.channelSendLock)
                                                  {
                                                      if (c.closeMessageSent)
                                                          throw new IOException("Cannot request X11 on this channel (" + c.getReasonClosed() + ")");
                                                      tm.sendMessage(psr.getPayload());
                                          Severity: Major
                                          Found in src/main/java/com/trilead/ssh2/channel/ChannelManager.java and 6 other locations - About 30 mins to fix
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 661..666
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 697..702
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 730..735
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 790..795
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 822..827
                                          src/main/java/com/trilead/ssh2/channel/ChannelManager.java on lines 857..862

                                          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 40.

                                          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