aceleradora-TW/nao-me-calo

View on GitHub

Showing 66 of 66 total issues

Method has too many lines. [597/30]
Open

  def get_bad_word
    bad_words = ["babaca",
      "babacÊo",
      "babacão",
      "babacaum",
Severity: Minor
Found in app/helpers/application_helper.rb by rubocop

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Module has too many lines. [638/250]
Open

module ApplicationHelper

  def set_average_style(average)
    case average
    when "Péssimo"
Severity: Minor
Found in app/helpers/application_helper.rb by rubocop

This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method get_bad_word has 597 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def get_bad_word
    bad_words = ["babaca",
      "babacÊo",
      "babacão",
      "babacaum",
Severity: Major
Found in app/helpers/application_helper.rb - About 2 days to fix

    File application_helper.rb has 639 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module ApplicationHelper
    
      def set_average_style(average)
        case average
        when "Péssimo"
    Severity: Major
    Found in app/helpers/application_helper.rb - About 1 day to fix

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

        function checkMail(){
          var emailExp = /^(([^<>()\[\]\\.,;:=/{}+!\s@']+(\.[^<>()\[\]\\.,;:=/{}+!\s@]+)*)|('.+'))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
          if(checking('#emailEvaluate', emailExp)){
            $('#emailEvaluate').removeClass('error');
            $('#emailAlertText').addClass('hidden');
      Severity: Major
      Found in app/assets/javascripts/ratings.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/ratings.js on lines 222..235

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

      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

        function checkName(){
          var nameExp = /^[A-Za-záàâãéèêíïóôõöúçñÁÀÂÃÉÈÍÏÓÔÕÖÚÇÑ ]+$/
          if (checking('#nameEvaluate', nameExp)){
            $('#nameEvaluate').removeClass('error');
            $('#nameAlertText').addClass('hidden');
      Severity: Major
      Found in app/assets/javascripts/ratings.js and 1 other location - About 4 hrs to fix
      app/assets/javascripts/ratings.js on lines 237..250

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

      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 create has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

        def create
          if params[:accepted_terms] && params[:rating][:rating_date] && params[:rating][:cpf]
      
            if Obscenity.profane?(rating_params[:description])
              redirect_to controller: :ratings, action: :new, placeId: params[:placeId]
      Severity: Minor
      Found in app/controllers/ratings_controller.rb - About 4 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

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

        $('#showMoreWorst').click(function(){
          limitListWorst = ( limitListWorst + 5 <= sizeListWorst) ? limitListWorst + 5 : sizeListWorst;
          $('.list-ranking-worst li:lt(' + limitListWorst + ')').show();
          $('html, body').animate({
            scrollTop: $('#showMoreWorst').offset().top
      Severity: Major
      Found in app/assets/javascripts/ranking.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/ranking.js on lines 24..31

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

      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

        $('#showMoreBest').click(function(){
          limitListBest = ( limitListBest + 5 <= sizeListBest) ? limitListBest + 5 : sizeListBest;
          $('.list-ranking-best li:lt(' + limitListBest + ')').show();
          $('html, body').animate({
            scrollTop: $('#showMoreBest').offset().top
      Severity: Major
      Found in app/assets/javascripts/ranking.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/ranking.js on lines 33..40

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

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

          $('#abuse-first').click(function(){
            $('#article-1').fadeToggle("slow");
            $('#discriminacao_down').toggleClass('hidden');
            $('#discriminacao_right').toggleClass('hidden');
      
      
      Severity: Major
      Found in app/assets/javascripts/help.js and 5 other locations - About 3 hrs to fix
      app/assets/javascripts/help.js on lines 24..31
      app/assets/javascripts/help.js on lines 33..41
      app/assets/javascripts/help.js on lines 43..50
      app/assets/javascripts/help.js on lines 52..59
      app/assets/javascripts/help.js on lines 61..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 101.

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

          $('#abuse-three').click(function(){
            $('#article-3').fadeToggle("slow");
            $('#racial_down').toggleClass('hidden');
            $('#racial_right').toggleClass('hidden');
            $('html, body').animate({
      Severity: Major
      Found in app/assets/javascripts/help.js and 5 other locations - About 3 hrs to fix
      app/assets/javascripts/help.js on lines 13..22
      app/assets/javascripts/help.js on lines 24..31
      app/assets/javascripts/help.js on lines 43..50
      app/assets/javascripts/help.js on lines 52..59
      app/assets/javascripts/help.js on lines 61..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 101.

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

          $('#abuse-second').click(function(){
            $('#article-2').fadeToggle("slow");
            $('#violencia_down').toggleClass('hidden');
            $('#violencia_right').toggleClass('hidden');
            $('html, body').animate({
      Severity: Major
      Found in app/assets/javascripts/help.js and 5 other locations - About 3 hrs to fix
      app/assets/javascripts/help.js on lines 13..22
      app/assets/javascripts/help.js on lines 33..41
      app/assets/javascripts/help.js on lines 43..50
      app/assets/javascripts/help.js on lines 52..59
      app/assets/javascripts/help.js on lines 61..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 101.

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

          $('#abuse-five').click(function(){
            $('#article-5').fadeToggle("slow");
            $('#mental_down').toggleClass('hidden');
            $('#mental_right').toggleClass('hidden');
            $('html, body').animate({
      Severity: Major
      Found in app/assets/javascripts/help.js and 5 other locations - About 3 hrs to fix
      app/assets/javascripts/help.js on lines 13..22
      app/assets/javascripts/help.js on lines 24..31
      app/assets/javascripts/help.js on lines 33..41
      app/assets/javascripts/help.js on lines 43..50
      app/assets/javascripts/help.js on lines 61..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 101.

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

          $('#abuse-four').click(function(){
            $('#article-4').fadeToggle("slow");
            $('#homofobia_down').toggleClass('hidden');
            $('#homofobia_right').toggleClass('hidden');
            $('html, body').animate({
      Severity: Major
      Found in app/assets/javascripts/help.js and 5 other locations - About 3 hrs to fix
      app/assets/javascripts/help.js on lines 13..22
      app/assets/javascripts/help.js on lines 24..31
      app/assets/javascripts/help.js on lines 33..41
      app/assets/javascripts/help.js on lines 52..59
      app/assets/javascripts/help.js on lines 61..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 101.

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

          $('#abuse-six').click(function(){
            $('#article-6').fadeToggle("slow");
            $('#transmissiveis_down').toggleClass('hidden');
            $('#transmissiveis_right').toggleClass('hidden');
            $('html, body').animate({
      Severity: Major
      Found in app/assets/javascripts/help.js and 5 other locations - About 3 hrs to fix
      app/assets/javascripts/help.js on lines 13..22
      app/assets/javascripts/help.js on lines 24..31
      app/assets/javascripts/help.js on lines 33..41
      app/assets/javascripts/help.js on lines 43..50
      app/assets/javascripts/help.js on lines 52..59

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

      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

      Cyclomatic complexity for create is too high. [15/6]
      Open

        def create
          if params[:accepted_terms] && params[:rating][:rating_date] && params[:rating][:cpf]
      
            if Obscenity.profane?(rating_params[:description])
              redirect_to controller: :ratings, action: :new, placeId: params[:placeId]

      This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.

      An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.

      Function initAutocomplete has 63 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function initAutocomplete () {
        var mapField = $('#map')[0]
        map = new google.maps.Map(mapField, {
          center: {lat: -30.0277, lng: -51.2287},
          zoom: 12
      Severity: Major
      Found in app/assets/javascripts/welcome.js - About 2 hrs to fix

        Function has too many statements (36). Maximum allowed is 30.
        Open

        $(document).ready(function(){
        Severity: Minor
        Found in app/assets/javascripts/ratings.js by eslint

        enforce a maximum number of statements allowed in function blocks (max-statements)

        The max-statements rule allows you to specify the maximum number of statements allowed in a function.

        function foo() {
          var bar = 1; // one statement
          var baz = 2; // two statements
          var qux = 3; // three statements
        }

        Rule Details

        This rule enforces a maximum number of statements allowed in function blocks.

        Options

        This rule has a number or object option:

        • "max" (default 10) enforces a maximum number of statements allows in function blocks

        Deprecated: The object property maximum is deprecated; please use the object property max instead.

        This rule has an object option:

        • "ignoreTopLevelFunctions": true ignores top-level functions

        max

        Examples of incorrect code for this rule with the default { "max": 10 } option:

        /*eslint max-statements: ["error", 10]*/
        /*eslint-env es6*/
        
        function foo() {
          var foo1 = 1;
          var foo2 = 2;
          var foo3 = 3;
          var foo4 = 4;
          var foo5 = 5;
          var foo6 = 6;
          var foo7 = 7;
          var foo8 = 8;
          var foo9 = 9;
          var foo10 = 10;
        
          var foo11 = 11; // Too many.
        }
        
        let foo = () => {
          var foo1 = 1;
          var foo2 = 2;
          var foo3 = 3;
          var foo4 = 4;
          var foo5 = 5;
          var foo6 = 6;
          var foo7 = 7;
          var foo8 = 8;
          var foo9 = 9;
          var foo10 = 10;
        
          var foo11 = 11; // Too many.
        };

        Examples of correct code for this rule with the default { "max": 10 } option:

        /*eslint max-statements: ["error", 10]*/
        /*eslint-env es6*/
        
        function foo() {
          var foo1 = 1;
          var foo2 = 2;
          var foo3 = 3;
          var foo4 = 4;
          var foo5 = 5;
          var foo6 = 6;
          var foo7 = 7;
          var foo8 = 8;
          var foo9 = 9;
          var foo10 = 10;
          return function () {
        
            // The number of statements in the inner function does not count toward the
            // statement maximum.
        
            return 42;
          };
        }
        
        let foo = () => {
          var foo1 = 1;
          var foo2 = 2;
          var foo3 = 3;
          var foo4 = 4;
          var foo5 = 5;
          var foo6 = 6;
          var foo7 = 7;
          var foo8 = 8;
          var foo9 = 9;
          var foo10 = 10;
          return function () {
        
            // The number of statements in the inner function does not count toward the
            // statement maximum.
        
            return 42;
          };
        }

        ignoreTopLevelFunctions

        Examples of additional correct code for this rule with the { "max": 10 }, { "ignoreTopLevelFunctions": true } options:

        /*eslint max-statements: ["error", 10, { "ignoreTopLevelFunctions": true }]*/
        
        function foo() {
          var foo1 = 1;
          var foo2 = 2;
          var foo3 = 3;
          var foo4 = 4;
          var foo5 = 5;
          var foo6 = 6;
          var foo7 = 7;
          var foo8 = 8;
          var foo9 = 9;
          var foo10 = 10;
          var foo11 = 11;
        }

        Related Rules

        • [complexity](complexity.md)
        • [max-depth](max-depth.md)
        • [max-len](max-len.md)
        • [max-nested-callbacks](max-nested-callbacks.md)
        • [max-params](max-params.md) Source: http://eslint.org/docs/rules/

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

            $("#bestPlacesButton").click(function(){
              $(this).addClass('Order-btn-pressed');
              $(this).css('font-size', '145%');
              $('#worstPlacesButton').removeClass('Order-btn-pressed');
              $('#worstPlacesButton').css('font-size', '120%');
        Severity: Major
        Found in app/assets/javascripts/welcome.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/welcome.js on lines 295..300

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

        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

            $("#worstPlacesButton").click(function(){
              $(this).addClass('Order-btn-pressed');
              $(this).css('font-size', '145%');
              $('#bestPlacesButton').removeClass('Order-btn-pressed');
              $('#bestPlacesButton').css('font-size', '120%');
        Severity: Major
        Found in app/assets/javascripts/welcome.js and 1 other location - About 2 hrs to fix
        app/assets/javascripts/welcome.js on lines 287..293

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

        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

        Severity
        Category
        Status
        Source
        Language