asdqwex/discobot

View on GitHub

Showing 37 of 112 total issues

Function onMessage has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    onMessage: function (bot, user, userID, channelID, message, rawEvent) {
      const imgParts = message.split('"')
      const memeType = imgParts[0].split(' ')[1]
      const memeList = {
        '10guy': 101440,
Severity: Major
Found in src/modules/meme.js - About 2 hrs to fix

    Function setupBot has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

    Severity: Minor
    Found in src/index.js - About 2 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 onMessage has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      onMessage: function (bot, user, userID, channelID, message, rawEvent) {
        var parts = message.split(' ')
        parts.splice(0, 2)
        var verb = parts.splice(0, 1).join()
        if (verb === 'at') {
    Severity: Minor
    Found in src/modules/reminder.js - About 1 hr to fix

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

      Severity: Minor
      Found in 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

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

        onMessage: function (bot, user, userID, channelID, message, rawEvent) {
          var parts = message.split(' ')
          parts.splice(0, 2)
          var verb = parts.splice(0, 1).join()
          if (verb === 'at') {
      Severity: Minor
      Found in src/modules/reminder.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 onMessage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
          const rollMatches = search => {
            return regex`
            (
              (?<numDice> \d{0,4})
      Severity: Minor
      Found in src/modules/dice.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 onMessage has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Severity: Minor
      Found in src/index.js - About 1 hr to fix

        Function setupBot has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Severity: Minor
        Found in src/index.js - About 1 hr to fix

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

          Severity: Minor
          Found in 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

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

          Severity: Minor
          Found in src/index.js - About 1 hr to fix

            Function onMessage has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
            Severity: Major
            Found in src/modules/8ball.js - About 50 mins to fix

              Function onMessage has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
              Severity: Major
              Found in src/modules/dice.js - About 50 mins to fix

                Function onMessage has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
                Severity: Major
                Found in src/modules/say.js - About 50 mins to fix

                  Function onMessage has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
                  Severity: Major
                  Found in src/modules/scrub.js - About 50 mins to fix

                    Function onMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      onMessage: function (bot, user, userID, channelID, message, rawEvent) {
                    Severity: Minor
                    Found in src/modules/coin.js - About 45 mins to fix

                      Function onMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        onMessage: function (bot, user, userID, channelID, message, rawEvent) {
                      Severity: Minor
                      Found in src/modules/yomama.js - About 45 mins to fix

                        Function onMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        Severity: Minor
                        Found in src/modules/goodshit.js - About 45 mins to fix

                          Function onMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                            onMessage: function (bot, user, userID, channelID, message, rawEvent) {
                          Severity: Minor
                          Found in src/modules/ping.js - About 45 mins to fix

                            Function onMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              onMessage: function (bot, user, userID, channelID, message, rawEvent) {
                            Severity: Minor
                            Found in src/modules/cat.js - About 45 mins to fix

                              Function onMessage has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                onMessage: function (bot, user, userID, channelID, message, rawEvent) {
                              Severity: Minor
                              Found in src/modules/lol.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language