gappleto97/p2p-project

View on GitHub

Showing 45 of 45 total issues

Function gen_walker has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function gen_walker(folder) {
    return function done(err, res) {
        if (err) throw err;
        var docs_folder = path.resolve('docs', folder_map[folder]);
        for (var i = 0; i < res.length; i++)  {
Severity: Minor
Found in docs/docs_walker.js - 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

Function gen_walker has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function gen_walker(folder) {
    return function done(err, res) {
        if (err) throw err;
        var docs_folder = path.resolve('docs', folder_map[folder]);
        for (var i = 0; i < res.length; i++)  {
Severity: Minor
Found in docs/docs_walker.js - About 1 hr to fix

Function done has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    return function done(err, res) {
        if (err) throw err;
        var docs_folder = path.resolve('docs', folder_map[folder]);
        for (var i = 0; i < res.length; i++)  {
            var file = path.resolve('.', folder, res[i]);
Severity: Minor
Found in docs/docs_walker.js - About 1 hr to fix

Parameter name 'fed_string' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

    private static String[] process_string(byte[] fed_string)   {
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

To validate catch parameters please useCatchParameterName.

To validate lambda parameters please useLambdaParameterName.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Parameter name 'i' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

    public static String to_base_58(long i)    {
Severity: Minor
Found in jv_src/base.java by checkstyle

Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

To validate catch parameters please useCatchParameterName.

To validate lambda parameters please useLambdaParameterName.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Local variable name 'fifty_eight' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

        BigInteger fifty_eight = new BigInteger("58");
Severity: Minor
Found in jv_src/base.java by checkstyle

Checks that local, non-final variable names conform to a specified pattern.A catch parameter is considered to be a local variable.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Wrong lexicographical order for 'java.math.BigInteger' import. Should be before 'java.security.NoSuchAlgorithmException'.
Open

import java.math.BigInteger;
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Parameter name 'msg_type' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

    public InternalMessage(String msg_type, String sender, String[] payload, long timestamp) {
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

To validate catch parameters please useCatchParameterName.

To validate lambda parameters please useLambdaParameterName.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Member name 'msg_type' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

    String msg_type;
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Parameter name 'fed_string' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

    private static byte[] decompress_string(byte[] fed_string, byte[][] compressions)   {
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

To validate catch parameters please useCatchParameterName.

To validate lambda parameters please useLambdaParameterName.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Parameter name 'fed_string' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

    public static InternalMessage feed_string(byte[] fed_string, byte[][] compressions) throws Exception     {
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

To validate catch parameters please useCatchParameterName.

To validate lambda parameters please useLambdaParameterName.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Type name 'protocol' must match pattern '^[A-Z][a-zA-Z0-9]*$'.
Open

public class protocol   {
Severity: Minor
Found in jv_src/protocol.java by checkstyle

Wrong lexicographical order for 'java.math.BigInteger' import. Should be before 'java.security.NoSuchAlgorithmException'.
Open

import java.math.BigInteger;
Severity: Minor
Found in jv_src/protocol.java by checkstyle

Checks that the groups of import declarations appear in the order specifiedby the user. If there is an import but its group is not specified in theconfiguration such an import should be placed at the end of the import list.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Abbreviation in name 'getUTC' must contain no more than '2' consecutive capital letters.
Open

    public static long getUTC() {
Severity: Minor
Found in jv_src/base.java by checkstyle

Validates abbreviations (consecutive capital letters) length in identifier name,it also allows to enforce camel case naming. Please read more atGoogle Style Guideto get to know how to avoid long abbreviations in names.

allowedAbbreviationLength specifies how many consecutive capital letters areallowed in the identifier.A value of 3 indicates that up to 4 consecutive capital letters are allowed,one after the other, before a violation is printed. The identifier 'MyTEST' would beallowed, but 'MyTESTS' would not be.A value of 0 indicates that only 1 consecutive capital letter is allowed. Thisis what should be used to enforce strict camel casing. The identifier 'MyTest' wouldbe allowed, but 'MyTEst' would not be.

ignoreFinal, ignoreStatic, and ignoreStaticFinalcontrol whether variables with the respective modifiers are to be ignored.Note that a variable that is both static and final will always be considered underignoreStaticFinal only, regardless of the values of ignoreFinaland ignoreStatic. So for example if ignoreStatic is true butignoreStaticFinal is false, then static final variables will not be ignored.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Local variable name 'i' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

        BigInteger i = new BigInteger(1, digest);
Severity: Minor
Found in jv_src/protocol.java by checkstyle

Checks that local, non-final variable names conform to a specified pattern.A catch parameter is considered to be a local variable.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Type name 'base' must match pattern '^[A-Z][a-zA-Z0-9]*$'.
Open

public class base   {
Severity: Minor
Found in jv_src/base.java by checkstyle

Local variable name 'pack_len' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

            byte[] pack_len = Arrays.copyOfRange(fed_string, processed, processed + 4);
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Checks that local, non-final variable names conform to a specified pattern.A catch parameter is considered to be a local variable.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Local variable name 'sanitized_string' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

        byte[] sanitized_string = InternalMessage.sanitize_string(fed_string, sizeless);
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Checks that local, non-final variable names conform to a specified pattern.A catch parameter is considered to be a local variable.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Line is longer than 100 characters (found 116).
Open

    public static String protocol_version = String.valueOf(version_info[0]) + "." + String.valueOf(version_info[1]);
Severity: Minor
Found in jv_src/base.java by checkstyle

Checks for long lines.

Rationale: Long lines are hard to read in printouts or if developershave limited screen space for the source code, e.g. if the IDEdisplays additional information like project tree, class hierarchy,etc.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Parameter name 'fed_string' must match pattern '^[a-z][a-z0-9][a-zA-Z0-9]*$'.
Open

    public static InternalMessage feed_string(byte[] fed_string, boolean sizeless, byte[][] compressions) throws Exception     {
Severity: Minor
Found in jv_src/InternalMessage.java by checkstyle

Checks that method parameter names conform to a specified pattern.By using accessModifiers property it is possibleto specify different formats for methods at different visibility levels.

To validate catch parameters please useCatchParameterName.

To validate lambda parameters please useLambdaParameterName.

This documentation is written and maintained by the Checkstyle community and is covered under the same license as the Checkstyle project.

Severity
Category
Status
Source
Language