connectbot/sshlib

View on GitHub

Showing 244 of 412 total issues

Method onConnect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        private void onConnect(Socks5Server server) throws IOException {
            final Channel cn;

            String destHost = server.getHostName();
            if (destHost == null) {
Severity: Minor
Found in src/main/java/com/trilead/ssh2/channel/DynamicAcceptThread.java - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method isPEMEncrypted has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static final boolean isPEMEncrypted(PEMStructure ps) throws IOException
    {
        if (ps.pemType == PEM_OPENSSH_PRIVATE_KEY) {
            TypesReader tr = new TypesReader(ps.data);
            byte[] magic = tr.readBytes(OPENSSH_V1_MAGIC.length);
Severity: Minor
Found in src/main/java/com/trilead/ssh2/crypto/PEMDecoder.java - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method decodePublicKey has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public PublicKey decodePublicKey(byte[] key) throws IOException {
        TypesReader tr = new TypesReader(key);

        String key_format = tr.readString();
Severity: Minor
Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.java - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method decodeSSHECDSASignature has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private byte[] decodeSSHECDSASignature(byte[] sig) throws IOException {
        byte[] rsArray;

        TypesReader tr = new TypesReader(sig);

Severity: Minor
Found in src/main/java/com/trilead/ssh2/signature/ECDSASHA2Verify.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

Severity
Category
Status
Source
Language