caffeinery/coffea

View on GitHub

Showing 55 of 81 total issues

Function exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function () {
    return function (irc) {
        irc.nick = function ircNick(nick, network, fn) {
            if (!network) network = '0';
            this.networked_me[network] = this.getUser(nick, network);
Severity: Minor
Found in lib/plugins/nick.js - About 55 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

Function _setupSASL has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

Client.prototype._setupSASL = function (stream_id, info) {
    this.on('cap_ack', function (err, event) {
        if (event.capability === 'sasl') {
            this.sasl.mechanism('PLAIN', stream_id);
            if (info.sasl && info.sasl.account && info.sasl.password) {
Severity: Minor
Found in index.js - About 45 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

Avoid deeply nested control flow statements.
Open

                                switch (mode) {
                                case 'Y':
                                    channel.names[argument] = '!';
                                    break;
                                case 'q':
Severity: Major
Found in lib/plugins/mode.js - About 45 mins to fix

    Function parseTarget has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    exports.parseTarget = function (target_raw) {
        var target, network;
        if (typeof target_raw !== "string") {
            // extract network from channel/user object
            network = exports.extractNetwork(target_raw);
    Severity: Minor
    Found in lib/utils.js - About 45 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

    Function cycle has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            irc.cycle = function ircCycle(channels, msg, keys, network, fn) {
    Severity: Minor
    Found in lib/plugins/join.js - About 35 mins to fix

      Function kick has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              irc.kick = function ircKick(channels, nicks, msg, network, fn) {
      Severity: Minor
      Found in lib/plugins/kick.js - About 35 mins to fix

        Function chanmode has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                irc.chanmode = function ircChanmode(channel, mode, target, network, fn) {
        Severity: Minor
        Found in lib/plugins/mode.js - About 35 mins to fix

          Function _reply has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          Event.prototype._reply = function _reply(action, message) {
              if (this.channel || this.user) {
                  var fn = this.irc[action];
                  if (typeof fn === 'function') {
                      fn = fn.bind(this.irc);
          Severity: Minor
          Found in lib/event.js - About 35 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

          Function emit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.emit = function (instance, network, event, data) {
              if (!data) {
                  data = {};
              }
          
          
          Severity: Minor
          Found in lib/utils.js - About 35 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

          Function exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function () {
              return function (irc) {
                  irc.on('data', function (err, msg) {
                      var network = msg.network;
                      if (msg.command === '354') {
          Severity: Minor
          Found in lib/plugins/whox.js - About 35 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

          Function exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function () {
              return function (irc) {
                  irc.capLs = function capLs(network, fn) {
                      irc.write("CAP LS", network, fn);
                  };
          Severity: Minor
          Found in lib/plugins/cap.js - About 35 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

          Function exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function () {
              return function (irc) {
                  irc.on('data', function (err, msg) {
                      var network = msg.network;
                      if (msg.command === 'AWAY') {
          Severity: Minor
          Found in lib/plugins/cap-away-notify.js - About 35 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

          Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function () {
              return function (irc) {
                  irc.notice = function ircNotice(target, msg, network, fn) {
                      var parse = utils.parseTarget(target);
                      if (!network) { network = parse.network; }
          Severity: Minor
          Found in lib/plugins/notice.js - 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

          Function parseTags has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          Parser.prototype._parseTags = function parseTags() {
              if (this.line.charCodeAt(0) === 64) {
                  var tags, tag, pair;
          
                  this.space = this.line.indexOf(' ');
          Severity: Minor
          Found in lib/parser/parser.js - 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

          Function exports has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

          module.exports = function(){
              return function (irc) {
                  irc.on('data', function (err, msg) {
                      var network = msg.network;
                      if ('PONG' === msg.command) {
          Severity: Minor
          Found in lib/plugins/ping.js - 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