ESheahan/espolea

View on GitHub

Showing 36 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

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

                    path.enter().append("path")
                        .attr("class","arc")
                        .attr("transform", "translate(" + _width/2 + "," + _width/2 + ")")
                        .attr("d", _arc);
        Severity: Major
        Found in app/assets/javascripts/radialProgress.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/radialProgress.js on lines 106..109

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

        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

                    path2.enter().append("path")
                        .attr("class","arc2")
                        .attr("transform", "translate(" + _width/2 + "," + _width/2 + ")")
                        .attr("d", _arc2);
        Severity: Major
        Found in app/assets/javascripts/radialProgress.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/radialProgress.js on lines 99..102

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

        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

        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

        Similar blocks of code found in 2 locations. 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 and 1 other location - About 40 mins to fix
        app/controllers/reviews_controller.rb on lines 88..106

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

        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

          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 and 1 other location - About 40 mins to fix
        app/controllers/reviews_controller.rb on lines 122..138

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

        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

        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

        Rails 4.2.1 is vulnerable to denial of service via mime type caching (CVE-2016-0751). Upgrade to Rails version 4.2.5.1
        Open

            rails (4.2.1)
        Severity: Minor
        Found in Gemfile.lock by brakeman

        Render path contains parameter value
        Open

            render template: "pages/#{params[:page]}"

        When a call to render uses a dynamically generated path, template name, file name, or action, there is the possibility that a user can access templates that should be restricted. The issue may be worse if those templates execute code or modify the database.

        This warning is shown whenever the path to be rendered is not a static string or symbol.

        These warnings are often false positives, however, because it can be difficult to manipulate Rails' assumptions about paths to perform malicious behavior. Reports of dynamic render paths should be checked carefully to see if they can actually be manipulated maliciously by the user.

        Rails 4.2.1 does not encode JSON keys (CVE-2015-3226). Upgrade to Rails version 4.2.2
        Open

            rails (4.2.1)
        Severity: Minor
        Found in Gemfile.lock by brakeman

        Rails 4.2.1 content_tag does not escape double quotes in attribute values (CVE-2016-6316). Upgrade to 4.2.7.1
        Open

            rails (4.2.1)
        Severity: Minor
        Found in Gemfile.lock by brakeman

        Loofah 2.0.3 is vulnerable (CVE-2018-8048). Upgrade to 2.1.2
        Open

            loofah (2.0.3)
        Severity: Minor
        Found in Gemfile.lock by brakeman

        Rails 4.2.1 contains a SQL injection vulnerability (CVE-2016-6317). Upgrade to 4.2.7.1
        Open

            rails (4.2.1)
        Severity: Critical
        Found in Gemfile.lock by brakeman

        Rails 4.2.1 is vulnerable to denial of service via XML parsing (CVE-2015-3227). Upgrade to Rails version 4.2.2
        Open

            rails (4.2.1)
        Severity: Minor
        Found in Gemfile.lock by brakeman

        rails-html-sanitizer 1.0.3 is vulnerable (CVE-2018-3741). Upgrade to 1.0.4
        Open

            rails-html-sanitizer (1.0.3)
        Severity: Minor
        Found in Gemfile.lock by brakeman

        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