connectbot/sshlib

View on GitHub

Showing 412 of 412 total issues

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

        for (int i = 0; i < hostnames.length; i++)
        {
            if (i != 0)
                writer.write(',');
            writer.write(hostnames[i]);
Severity: Minor
Found in src/main/java/com/trilead/ssh2/KnownHosts.java and 1 other location - About 40 mins to fix
src/main/java/com/trilead/ssh2/packets/TypesWriter.java on lines 158..163

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

        public static ECParameterSpec nistp384 = new ECParameterSpec(
            new EllipticCurve(
                new ECFieldFp(new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF", 16)),
                new BigInteger("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC", 16),
                new BigInteger("B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF", 16)),
Severity: Major
Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java and 2 other locations - About 40 mins to fix
src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java on lines 458..466
src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java on lines 572..580

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

        for (int i = 0; i < v.length; i++)
        {
            if (i > 0)
                sb.append(',');
            sb.append(v[i]);
Severity: Minor
Found in src/main/java/com/trilead/ssh2/packets/TypesWriter.java and 1 other location - About 40 mins to fix
src/main/java/com/trilead/ssh2/KnownHosts.java on lines 699..704

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

    public void rm(String fileName) throws IOException
    {
        int req_id = generateNextRequestID();

        TypesWriter tw = new TypesWriter();
Severity: Minor
Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 40 mins to fix
src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 984..994

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

    public void rmdir(String dirName) throws IOException
    {
        int req_id = generateNextRequestID();

        TypesWriter tw = new TypesWriter();
Severity: Minor
Found in src/main/java/com/trilead/ssh2/SFTPv3Client.java and 1 other location - About 40 mins to fix
src/main/java/com/trilead/ssh2/SFTPv3Client.java on lines 966..976

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

        public static ECParameterSpec nistp256 = new ECParameterSpec(
            new EllipticCurve(
                new ECFieldFp(new BigInteger("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF", 16)),
                new BigInteger("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC", 16),
                new BigInteger("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b", 16)),
Severity: Major
Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java and 2 other locations - About 40 mins to fix
src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java on lines 515..523
src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java on lines 572..580

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 48.

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

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

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

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

Refactorings

Further Reading

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

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

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

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

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

      Method 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 replyToChallenge has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              String[] replyToChallenge(String name, String instruction, int numPrompts, String[] prompt, boolean[] echo)
          Severity: Minor
          Found in src/main/java/com/trilead/ssh2/InteractiveCallback.java - About 35 mins to fix

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

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

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

                  public byte[] calculateH(byte[] clientversion, byte[] serverversion, byte[] clientKexPayload,
                          byte[] serverKexPayload, byte[] hostKey) throws UnsupportedEncodingException
              Severity: Minor
              Found in src/main/java/com/trilead/ssh2/crypto/dh/GenericDhExchange.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 decryptData has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private static byte[] decryptData(byte[] data, byte[] pw, byte[] salt, int rounds, String algo) throws IOException
                  Severity: Minor
                  Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language