marano/bgirlz

View on GitHub

Showing 15 of 46 total issues

File bootstrap.js has 1251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.1.1
 * http://twitter.github.com/bootstrap/javascript.html#transitions
 * ===================================================
 * Copyright 2012 Twitter, Inc.
Severity: Major
Found in public/bootstrap/js/bootstrap.js - About 3 days to fix

    File spec.rb has 432 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require_relative 'spec_helper'
    
    describe 'Black Girls Code Website Publisher', :js => true do
    
      it 'publishes my website and show me info bar with site address' do
    Severity: Minor
    Found in spec.rb - About 6 hrs to fix

      Class Page has 39 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Page
        include MongoMapper::Document
      
        key :name, String
        key :middle_initial, String
      Severity: Minor
      Found in lib/model.rb - About 5 hrs to fix

        Method upload_page_and_assert_data_was_saved has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
        Open

        def upload_page_and_assert_data_was_saved(params, success = true)
          visit '/'
          fill_in 'name', :with => params[:name] if params[:name]
          fill_in 'middle_initial', :with => params[:middle_initial] if params[:middle_initial]
          fill_in 'last_name', :with => params[:last_name] if params[:last_name]
        Severity: Minor
        Found in spec_helper.rb - About 3 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 bindEvents has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function bindEvents(eventDiv) {
            pageCounter(eventDiv);
        
            eventDiv.find('.event-expand').click(function (event) {
              event.preventDefault();
        Severity: Major
        Found in public/list.js - About 3 hrs to fix

          File list.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          $(function () {
            $('.delete').click(function (e) {
              var ok = confirm("Are you sure you want to delete that page?");
              if (ok) {
                $(e.target).closest('form').submit();
          Severity: Minor
          Found in public/list.js - About 3 hrs to fix

            File model.rb has 276 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'open-uri'
            
            class Page
              include MongoMapper::Document
            
            
            Severity: Minor
            Found in lib/model.rb - About 2 hrs to fix

              Method upload_page_and_assert_data_was_saved has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def upload_page_and_assert_data_was_saved(params, success = true)
                visit '/'
                fill_in 'name', :with => params[:name] if params[:name]
                fill_in 'middle_initial', :with => params[:middle_initial] if params[:middle_initial]
                fill_in 'last_name', :with => params[:last_name] if params[:last_name]
              Severity: Minor
              Found in spec_helper.rb - About 1 hr to fix

                Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  , show: function () {
                      var $tip
                        , inside
                        , pos
                        , actualWidth
                Severity: Minor
                Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

                  Function slide has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    , slide: function (type, next) {
                        var $active = this.$element.find('.item.active')
                          , $next = next || $active[type]()
                          , isCycling = this.interval
                          , direction = type == 'next' ? 'left' : 'right'
                  Severity: Minor
                  Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

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

                        , show: function () {
                            var that = this
                              , e = $.Event('show')
                    
                            this.$element.trigger(e)
                    Severity: Minor
                    Found in public/bootstrap/js/bootstrap.js - About 1 hr to fix

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

                        def self.publish!(name, middle_initial, last_name, event, enable_comments, content)
                      Severity: Minor
                      Found in lib/model.rb - About 45 mins to fix

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

                          def redirect_home_with_input(name, middle_initial, last_name, event)
                            redirect "/?#{name.blank? ? '' : '&name=' + name }#{middle_initial.blank? ? '' : '&middle_initial=' + middle_initial }#{last_name.blank? ? '' : '&last_name=' + last_name }#{event.blank? ? '' : '&event=' + event }"
                          end
                        Severity: Minor
                        Found in lib/controller.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

                        Method publish! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def self.publish!(name, middle_initial, last_name, event, enable_comments, content)
                            return if invalid_page?(name, content)
                        
                            page_data = {name: name, middle_initial: middle_initial, last_name: last_name, event: event, :content => content, :enable_comments => enable_comments == 'on'}
                        
                        
                        Severity: Minor
                        Found in lib/model.rb - About 25 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

                        Method content_from has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def content_from(params)
                            link = params[:link]
                            page = params[:page]
                            html = params[:html]
                            return content_from_link(link) unless link.blank?
                        Severity: Minor
                        Found in lib/controller.rb - About 25 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