asdqwex/discobot

View on GitHub

Showing 112 of 112 total issues

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  it(`handles addition at the end of a roll`, () => {
    const {message: actual} = roller('kingles', '3d10+5')
    const expected = 'Kingles rolled 3d10+5! ( 8 + 10 + 1 ) + 5 = 24'

    assert.equal(actual, expected)
Severity: Major
Found in test/modules/dice.spec.js and 3 other locations - About 1 hr to fix
test/modules/dice.spec.js on lines 35..40
test/modules/dice.spec.js on lines 59..64
test/modules/dice.spec.js on lines 73..78

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 4 locations. Consider refactoring.
Open

  it(`handles counting successes at or more than a given value`, () => {
    const {message: actual} = roller('kingles', '4d10>8')
    const expected = 'Kingles rolled 4d10>8! ( 1 + 3 + 8 + 7 ) = 1 Success'

    assert.equal(actual, expected)
Severity: Major
Found in test/modules/dice.spec.js and 3 other locations - About 1 hr to fix
test/modules/dice.spec.js on lines 35..40
test/modules/dice.spec.js on lines 59..64
test/modules/dice.spec.js on lines 66..71

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 55.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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 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/8ball.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/game.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/youtube.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/help.js - About 45 mins to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                    it('handles counting succcesses at exactly a given value', () => {
                      const {message: actual} = roller('kingles', '4d10=9')
                      const expected = 'Kingles rolled 4d10=9! ( 2 + 7 + 3 + 9 ) = 1 Success'
                  
                      assert.equal(actual, expected)
                  Severity: Minor
                  Found in test/modules/dice.spec.js and 1 other location - About 45 mins to fix
                  test/modules/dice.spec.js on lines 80..85

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 50.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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/quote.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/decide.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

                        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

                              onMessage: function (bot, user, userID, channelID, message, rawEvent) {
                            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/giphy.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/fortune.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/join.js - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language