botwillacceptanything/botwillacceptanything

View on GitHub
lib/integrations/irc.js

Summary

Maintainability
C
1 day
Test Coverage

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

        module.exports = function () {
            var conversations = {};
            var muted = false;
            if(!config.irc) {
                console.error('No IRC settings in config. IRC bot disabled.');
Severity: Major
Found in lib/integrations/irc.js - About 4 hrs to fix

    Function checkInitNewConversation has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                function checkInitNewConversation(nick) {
                    if(nick !== config.irc.user) {
                        if(conversations[nick] === undefined || conversations[nick] === null) {
                            var c = new Conversation(nick, config.irc.user);
                            conversations[nick] = c;
    Severity: Minor
    Found in lib/integrations/irc.js - About 1 hr to fix

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

                                  var now_utc = new Date(now.getUTCFullYear(),
                                      now.getUTCMonth(), now.getUTCDate(),
                                      now.getUTCHours(), now.getUTCMinutes(),
                                      now.getUTCSeconds());
      Severity: Major
      Found in lib/integrations/irc.js and 2 other locations - About 1 hr to fix
      lib/routes/video.js on lines 23..26
      lib/routes/votes.js on lines 17..20

      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 58.

      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 2 locations. Consider refactoring.
      Open

                              c.on("unmute", function() {
                                  for(var key in conversations) {
                                      conversations[key].unmute();
                                      muted = false;
                                  }
      Severity: Minor
      Found in lib/integrations/irc.js and 1 other location - About 50 mins to fix
      lib/integrations/irc.js on lines 68..73

      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 51.

      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 2 locations. Consider refactoring.
      Open

                              c.on("mute", function() {
                                  for(var key in conversations) {
                                      conversations[key].mute();
                                      muted = true;
                                  }
      Severity: Minor
      Found in lib/integrations/irc.js and 1 other location - About 50 mins to fix
      lib/integrations/irc.js on lines 74..79

      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 51.

      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

                                  var secondsPastMidnightUTC = now_utc.getSeconds() + 60 *
                                      now_utc.getMinutes() + 60 * 60 * now_utc.getHours();
      Severity: Major
      Found in lib/integrations/irc.js and 3 other locations - About 40 mins to fix
      lib/routes/video.js on lines 40..41
      lib/routes/votes.js on lines 15..16
      lib/routes/votes.js on lines 21..22

      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 48.

      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 2 locations. Consider refactoring.
      Open

                      destroy: function () {
                        events.removeListener('bot.pull_request.vote_started', eventPullRequestVoteStarted);
                        events.removeListener('github.pull_request.closed', eventPullRequestClosed);
                        events.removeListener('github.pull_request.merged', eventPullRequestMerged);
                      },
      Severity: Minor
      Found in lib/integrations/irc.js and 1 other location - About 35 mins to fix
      lib/integrations/twitter.js on lines 64..68

      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 46.

      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

      There are no issues that match your filters.

      Category
      Status