caffeinery/coffea

View on GitHub

Showing 55 of 81 total issues

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

module.exports = function () {
    return function (irc) {
        irc.whoisCallbacks = {};

        /**
Severity: Minor
Found in lib/plugins/whois.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

Function exports has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function () {
    var channelCache = {},
        channelList = {};
    return function (irc) {

Severity: Minor
Found in lib/plugins/channel.js - About 1 hr to fix

    Function exports has 37 lines of code (exceeds 25 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 1 hr to fix

      Function exports has a Cognitive Complexity of 12 (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 === 'JOIN' && irc.capabilities.indexOf('extended-join') > -1) {
      Severity: Minor
      Found in lib/plugins/cap-extended-join.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

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

      module.exports = function () {
          return function (irc) {
              irc.part = function ircPart(channels, msg, network, fn) {
                  if (typeof msg === 'function') {
                      fn = msg;
      Severity: Minor
      Found in lib/plugins/part.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

      Function write has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

      Client.prototype.write = function (str, network, fn) {
          // if network is the callback, then it wasn't defined either
          if (typeof(network) === 'function') {
              fn = network;
              network = undefined;
      Severity: Minor
      Found in 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

      Function exports has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function () {
          return function (irc) {
              irc.part = function ircPart(channels, msg, network, fn) {
                  if (typeof msg === 'function') {
                      fn = msg;
      Severity: Minor
      Found in lib/plugins/part.js - About 1 hr to fix

        Function exports has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function () {
            var serverInfo = {};
            return function (irc) {
        
                irc.getServerInfo = function (network) {
        Severity: Minor
        Found in lib/plugins/server.js - About 1 hr to fix

          Function exports has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function () {
              return function (irc) {
                  irc.kick = function ircKick(channels, nicks, msg, network, fn) {
                      if (typeof msg === 'function') {
                          fn = msg;
          Severity: Minor
          Found in lib/plugins/kick.js - About 1 hr to fix

            Function exports has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function () {
                return function (irc) {
                    function emitCommand(event, text) {
                        var message = irc.splitString(text);
                        debug("message: %s", JSON.stringify(message));
            Severity: Minor
            Found in lib/plugins/command.js - About 1 hr to fix

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

              module.exports = function () {
                  return function (irc) {
                      irc.kick = function ircKick(channels, nicks, msg, network, fn) {
                          if (typeof msg === 'function') {
                              fn = msg;
              Severity: Minor
              Found in lib/plugins/kick.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

              Function exports has a Cognitive Complexity of 11 (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 === 'RPL_AWAY') {
              Severity: Minor
              Found in lib/plugins/away.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

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

              module.exports = function () {
                  return function (irc) {
                      irc.sasl = {
                          method: '',
                          mechanism: function saslMechanism(mechanism, network, fn) {
              Severity: Minor
              Found in lib/plugins/cap-sasl.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

              Function add has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              Client.prototype.add = function (info) {
                  var stream, stream_id, streams = [];
                  var _this = this;
                  if (info instanceof Array) {
                      // We've been passed multiple server information
              Severity: Minor
              Found in 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

              Function parsePrefix has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

              Parser.prototype._parseParams = function parsePrefix() {
                  while (this.position < this.line.length) {
                      this.space = this.line.indexOf(" ", this.position);
              
                      // Trailing!
              Severity: Minor
              Found in lib/parser/parser.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

              Function exports has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function () {
                  return function (irc) {
                      irc.identify = function (username, password, network, fn) {
                          if (typeof network === 'function') {
                            fn = network;
              Severity: Minor
              Found in lib/plugins/nickserv.js - About 1 hr to fix

                Function emit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                exports.emit = function (instance, network, event, data) {
                    if (!data) {
                        data = {};
                    }
                
                
                Severity: Minor
                Found in lib/utils.js - About 1 hr to fix

                  Function exports has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function () {
                      return function (irc) {
                          /**
                           * Quit the network.
                           *
                  Severity: Minor
                  Found in lib/plugins/quit.js - About 1 hr to fix

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

                    module.exports = function () {
                        return function (irc) {
                            irc.topic = function ircTopic(channel, topic, network, fn) {
                                var parse = utils.parseTarget(channel);
                                if (!network) { network = parse.network; }
                    Severity: Minor
                    Found in lib/plugins/topic.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 exports has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function () {
                        return function (irc) {
                            // TODO: maybe we should put these into other plugins too?
                            irc.pass = function ircPass(pass, network, fn) {
                                this.write('PASS ' + pass, network, fn);
                    Severity: Minor
                    Found in lib/plugins/core.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

                    Severity
                    Category
                    Status
                    Source
                    Language