ESheahan/espolea

View on GitHub

Showing 8 of 36 total issues

Function radialProgress has 169 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function radialProgress(parent) {
    var _data=null,
        _duration= 1000,
        _selection,
        _margin = {top:0, right:0, bottom:30, left:0},
Severity: Major
Found in app/assets/javascripts/radialProgress.js - About 6 hrs to fix

    Function component has 70 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function component() {
    
            _selection.each(function (data) {
    
                // Select the svg element, if it exists.
    Severity: Major
    Found in app/assets/javascripts/radialProgress.js - About 2 hrs to fix

      Function radialProgress has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

      function radialProgress(parent) {
          var _data=null,
              _duration= 1000,
              _selection,
              _margin = {top:0, right:0, bottom:30, left:0},
      Severity: Minor
      Found in app/assets/javascripts/radialProgress.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 sync_inputs has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          Marker.prototype.sync_inputs = function(settings) {
            var $address, $lat, $lng,
              _this = this;
            if (settings['sync_inputs']) {
              $lat = $(settings['sync_inputs']['lat']);
      Severity: Major
      Found in app/assets/javascripts/jquery.geolocateMap.js - About 2 hrs to fix

        Method add_unhelpful has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          def add_unhelpful
              user, review, _helpful, _unhelpful = retrieve_both
        
              if user and review
                  if not _unhelpful
        Severity: Minor
        Found in app/controllers/reviews_controller.rb - 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

        Method add_helpful has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          def add_helpful
            user, review, _helpful, _unhelpful = retrieve_both 
        
            if user and review
                if not _helpful
        Severity: Minor
        Found in app/controllers/reviews_controller.rb - 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

        Method calc_helpfulness has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

          def calc_helpfulness
              if self.helpful_list_id
                hful = self.helpful_list_id.length
              else
                hful = 0
        Severity: Minor
        Found in app/models/review.rb - About 35 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 check_conflict has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def check_conflict
                if current_user
                    if current_user.clinics_id and current_user.clinics_id == params[:review][:clinic_id].to_i
                        #Trying to create a review for own clinic -- conflict of interest
                        redirect_to request.referer and return
        Severity: Minor
        Found in app/controllers/reviews_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