sockethub/sockethub

View on GitHub
packages/irc2as/src/index.js

Summary

Maintainability
A
0 mins
Test Coverage

Function __processIRCCodes has 143 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

    __processIRCCodes(
        code,
        server,
        channel,
        pos1,
Severity: Major
Found in packages/irc2as/src/index.js - About 5 hrs to fix

    Function __processIRCCodes has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Wontfix

        __processIRCCodes(
            code,
            server,
            channel,
            pos1,
    Severity: Minor
    Found in packages/irc2as/src/index.js - About 3 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

    File index.js has 256 lines of code (exceeds 250 allowed). Consider refactoring.
    Invalid

    const events = require("events");
    const debug = require("debug")("irc2as");
    const ASEmitter = require("./as-emitter");
    
    const EVENT_INCOMING = "incoming",
    Severity: Minor
    Found in packages/irc2as/src/index.js - About 2 hrs to fix

      Function input has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Invalid

          input(incoming) {
              debug(incoming);
              if (typeof incoming !== "string") {
                  debug("unable to process incoming message as it was not a string.");
                  return false;
      Severity: Minor
      Found in packages/irc2as/src/index.js - About 1 hr to fix

        Function input has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Wontfix

            input(incoming) {
                debug(incoming);
                if (typeof incoming !== "string") {
                    debug("unable to process incoming message as it was not a string.");
                    return false;
        Severity: Minor
        Found in packages/irc2as/src/index.js - About 1 hr 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

        There are no issues that match your filters.

        Category
        Status