Showing 244 of 412 total issues
Method init
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void init() throws IOException
{
/* Send SSH_FXP_INIT (version 3) */
final int client_version = 3;
Method decodePublicKey
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public PublicKey decodePublicKey(byte[] key) throws IOException {
TypesReader tr = new TypesReader(key);
String key_format = tr.readString();
Method generateKeyFromPasswordSaltWithMD5
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static byte[] generateKeyFromPasswordSaltWithMD5(byte[] password, byte[] salt, int keyLen)
throws IOException
{
if (salt.length < 8)
throw new IllegalArgumentException("Salt needs to be at least 8 bytes for key generation.");
Method onConnect
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private void onConnect(Socks5Server server) throws IOException {
final Channel cn;
String destHost = server.getHostName();
if (destHost == null) {
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))
Method put
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void put(byte[] data, String remoteFileName, String remoteTargetDirectory, String mode) throws IOException
{
Session sess = null;
if ((remoteFileName == null) || (remoteTargetDirectory == null) || (mode == null))
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;
Method recommendHostkeyAlgorithms
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String[] recommendHostkeyAlgorithms(String hostname) {
List<String> preferredAlgos = new ArrayList<>();
List<PublicKey> keys = getAllKeys(hostname);
Method generateKeyFromPasswordSaltWithMD5
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static byte[] generateKeyFromPasswordSaltWithMD5(byte[] password, byte[] salt, int keyLen)
throws IOException
{
if (salt.length < 8)
throw new IllegalArgumentException("Salt needs to be at least 8 bytes for key generation.");
- 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 getFirstMatch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private String getFirstMatch(String[] client, String[] server) throws NegotiateException
{
if (client == null || server == null)
throw new IllegalArgumentException();
- 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 requestPTY
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public void requestPTY(String term, int term_width_characters, int term_height_characters, int term_width_pixels,
int term_height_pixels, byte[] terminal_modes) throws IOException
{
if (term == null)
throw new IllegalArgumentException("TERM cannot 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 put
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public void put(byte[] data, String remoteFileName, String remoteTargetDirectory, String mode) throws IOException
{
Session sess = null;
if ((remoteFileName == null) || (remoteTargetDirectory == null) || (mode == 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 addHostkey
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public void addHostkey(String[] hostnames, String serverHostKeyAlgorithm, byte[] serverHostKey) throws IOException
{
if (hostnames == null)
throw new IllegalArgumentException("hostnames 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 parseCLine
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private LenNamePair parseCLine(String line) throws IOException
{
/* Minimum line: "xxxx y z" ---> 8 chars */
long len;
- 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 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
Method calculateH
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public byte[] calculateH(String hashAlgo, byte[] clientversion, byte[] serverversion,
byte[] clientKexPayload, byte[] serverKexPayload, byte[] hostKey, DHGexParameters para)
Method init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void init() throws IOException
{
/* Send SSH_FXP_INIT (version 3) */
final int client_version = 3;
- 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
Avoid deeply nested control flow statements. Open
if ((c >= 32) && (c <= 126))
continue;
Avoid deeply nested control flow statements. Open
if (capableAlgo.equals(knownAlgo)) {
filteredAlgorithms.add(knownAlgo);
}
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public void initialize(CryptoWishList cwl, ServerHostKeyVerifier verifier, DHGexParameters dhgex,
int connectTimeout, SecureRandom rnd, ProxyData proxyData) throws IOException