Showing 244 of 412 total issues
Method openDirectory
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private final byte[] openDirectory(String path) throws IOException
{
int req_id = generateNextRequestID();
TypesWriter tw = new TypesWriter();
Method init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public void init(String name) throws IOException {
final DHParameterSpec spec;
if ("diffie-hellman-group18-sha512".equals(name)) {
spec = new DHParameterSpec(P18, G);
Method checkHashed
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private final boolean checkHashed(String entry, String hostname)
{
if (!entry.startsWith("|1|"))
return false;
Method get
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void get(String remoteFiles[], String localTargetDirectory) throws IOException
{
Session sess = null;
if ((remoteFiles == null) || (localTargetDirectory == null))
Method rawToBubblebabbleFingerprint
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
static final private String rawToBubblebabbleFingerprint(byte[] raw)
{
final char[] v = "aeiouy".toCharArray();
final char[] c = "bcdfghklmnprstvzx".toCharArray();
Method fstat
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public SFTPv3FileAttributes fstat(SFTPv3FileHandle handle) throws IOException
{
checkHandleValidAndOpen(handle);
int req_id = generateNextRequestID();
Method decode
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static byte[] decode(PKCS8EncodedKeySpec keySpec) throws InvalidKeySpecException {
byte[] encoded = keySpec.getEncoded();
if (encoded.length != ENCODED_SIZE) {
throw new InvalidKeySpecException("Key spec is of invalid size");
}
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 + ")");
Method calculateKey
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static byte[] calculateKey(HashForSSH2Types sh, BigInteger K, byte[] H, byte type, byte[] SessionID,
int keyLength)
{
byte[] res = new byte[keyLength];
Method statBoth
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private SFTPv3FileAttributes statBoth(String path, int statMethod) throws IOException
{
int req_id = generateNextRequestID();
TypesWriter tw = new TypesWriter();
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)
Method parseCLine
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private LenNamePair parseCLine(String line) throws IOException
{
/* Minimum line: "xxxx y z" ---> 8 chars */
long len;
Method run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void run()
{
try
{
receiveLoop();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method sendMessage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void sendMessage(byte[] msg) throws IOException
{
if (Thread.currentThread() == receiveThread)
throw new IOException("Assertion error: sendMessage may never be invoked by the receiver thread!");
- Read upRead up
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 verifySignature
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private boolean verifySignature(byte[] sig, byte[] hostkey) throws IOException {
SSHSignature sshSignature;
if (kxs.np.server_host_key_algo.equals(Ed25519Verify.get().getKeyFormat())) {
sshSignature = Ed25519Verify.get();
} else if (kxs.np.server_host_key_algo.equals(ECDSASHA2Verify.ECDSASHA2NISTP256Verify.get().getKeyFormat())) {
- Read upRead up
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 requestX11Forwarding
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void requestX11Forwarding(String hostname, int port, byte[] cookie, boolean singleConnection)
throws IOException
{
if (hostname == null)
throw new IllegalArgumentException("hostname argument may not be null");
- Read upRead up
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 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))
- Read upRead up
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 uncompress
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public byte[] uncompress(byte[] buffer, int start, int[] length) {
int inflated_end = 0;
inflate.next_in = buffer;
inflate.next_in_index = start;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void get(String remoteFiles[], String localTargetDirectory) throws IOException
{
Session sess = null;
if ((remoteFiles == null) || (localTargetDirectory == null))
- Read upRead up
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 initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private boolean initialize(String user) throws IOException
{
if (!initDone)
{
tm.registerMessageHandler(this, 0, 255);