dblock/slack-sup

View on GitHub

Showing 57 of 114 total issues

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

var cbpAnimatedHeader = (function() {

    var docElem = document.documentElement,
        header = document.querySelector( '.navbar-default' ),
        didScroll = false,
Severity: Minor
Found in public/js/cbpAnimatedHeader.js - About 1 hr to fix

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

        function next() {
          $active
            .removeClass('active')
            .find('> .dropdown-menu > .active')
              .removeClass('active')
    Severity: Minor
    Found in public/js/bootstrap.js - About 1 hr to fix

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

        Collapse.prototype.hide = function () {
          if (this.transitioning || !this.$element.hasClass('in')) return
      
          var startEvent = $.Event('hide.bs.collapse')
          this.$element.trigger(startEvent)
      Severity: Minor
      Found in public/js/bootstrap.js - About 1 hr to fix

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

          ScrollSpy.prototype.refresh = function () {
            var that          = this
            var offsetMethod  = 'offset'
            var offsetBase    = 0
        
        
        Severity: Minor
        Found in public/js/bootstrap.js - About 1 hr to fix

          Method set has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  def set(client, team, data, user, k, v)
          Severity: Minor
          Found in slack-sup/commands/set.rb - About 45 mins to fix

            Method set_api_token has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                    def set_api_token(client, team, data, user)
                      if !team.api?
                        set_api(client, team, data, user)
                      elsif user.team_admin? && !team.api_token
                        team.update_attributes!(api_token: SecureRandom.hex)
            Severity: Minor
            Found in slack-sup/commands/set.rb - 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

            Consider simplifying this complex logical expression.
            Open

              if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {
                throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')
              }
            Severity: Major
            Found in public/js/bootstrap.js - About 40 mins to fix

              Method set_opt_in has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      def set_opt_in(client, team, data, user, v = nil)
              Severity: Minor
              Found in slack-sup/commands/set.rb - About 35 mins to fix

                Method set_custom_profile_team_field has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        def set_custom_profile_team_field(client, team, data, user, v = nil)
                Severity: Minor
                Found in slack-sup/commands/set.rb - About 35 mins to fix

                  Method set_weeks has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          def set_weeks(client, team, data, user, v = nil)
                  Severity: Minor
                  Found in slack-sup/commands/set.rb - About 35 mins to fix

                    Method set_sync has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            def set_sync(client, team, data, user, v = nil)
                    Severity: Minor
                    Found in slack-sup/commands/set.rb - About 35 mins to fix

                      Method rotate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              def rotate(client, team, data, user, k)
                      Severity: Minor
                      Found in slack-sup/commands/set.rb - About 35 mins to fix

                        Method set_recency has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                def set_recency(client, team, data, user, v = nil)
                        Severity: Minor
                        Found in slack-sup/commands/set.rb - About 35 mins to fix

                          Method set_size has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  def set_size(client, team, data, user, v = nil)
                          Severity: Minor
                          Found in slack-sup/commands/set.rb - About 35 mins to fix

                            Method unset has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    def unset(client, team, data, user, k)
                            Severity: Minor
                            Found in slack-sup/commands/set.rb - About 35 mins to fix

                              Method set_day has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      def set_day(client, team, data, user, v = nil)
                              Severity: Minor
                              Found in slack-sup/commands/set.rb - About 35 mins to fix

                                Method set_message has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        def set_message(client, team, data, user, v = nil)
                                Severity: Minor
                                Found in slack-sup/commands/set.rb - About 35 mins to fix

                                  Method set_api has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          def set_api(client, team, data, user, v = nil)
                                  Severity: Minor
                                  Found in slack-sup/commands/set.rb - About 35 mins to fix

                                    Method set_time has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            def set_time(client, team, data, user, v = nil)
                                    Severity: Minor
                                    Found in slack-sup/commands/set.rb - About 35 mins to fix

                                      Method set_followup_day has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              def set_followup_day(client, team, data, user, v = nil)
                                      Severity: Minor
                                      Found in slack-sup/commands/set.rb - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language