rubycentral/cfp-app

View on GitHub

Showing 126 of 126 total issues

Function palette has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
Open

var palette = (function() {

  var proto = Array.prototype;
  var slice = function(arr, opt_begin, opt_end) {
    return proto.slice.apply(arr, proto.slice.call(arguments, 1));
Severity: Minor
Found in app/assets/javascripts/palette.js - About 2 days 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

File palette.js has 855 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/** @license
 *
 *     Colour Palette Generator script.
 *     Copyright (c) 2014 Google Inc.
 *
Severity: Major
Found in app/assets/javascripts/palette.js - About 2 days to fix

    Function palette has 239 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var palette = (function() {
    
      var proto = Array.prototype;
      var slice = function(arr, opt_begin, opt_end) {
        return proto.slice.apply(arr, proto.slice.call(arguments, 1));
    Severity: Major
    Found in app/assets/javascripts/palette.js - About 1 day to fix

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

        uploadFile(file, event, editor) {
          let url = '/image_uploads'
          let formData = new FormData()
      
          formData.append('file', file)
      Severity: Major
      Found in app/javascript/controllers/content_controller.js and 1 other location - About 1 day to fix
      app/javascript/controllers/editor_controller.js on lines 94..114

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

      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

        uploadFile(file, event, editor) {
          let url = '/image_uploads'
          let formData = new FormData()
      
          formData.append('file', file)
      Severity: Major
      Found in app/javascript/controllers/editor_controller.js and 1 other location - About 1 day to fix
      app/javascript/controllers/content_controller.js on lines 20..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 214.

      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

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

        if (next_link.length > 0) {
          if (localStorage.proposal_uuid_table_order !== undefined) {
            var proposal_uuids = JSON.parse(localStorage.proposal_uuid_table_order);
            var current_index = proposal_uuids.indexOf(next_link.data("proposal-uuid"));
            if (current_index + 1 < proposal_uuids.length) {
      Severity: Major
      Found in app/assets/javascripts/staff/proposals.js and 1 other location - About 7 hrs to fix
      app/assets/javascripts/staff/program/proposals.js on lines 19..34

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

      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

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

        if (next_link.length > 0) {
          if (localStorage.proposal_uuid_table_order !== undefined) {
            var proposal_uuids = JSON.parse(localStorage.proposal_uuid_table_order);
            var current_index = proposal_uuids.indexOf(next_link.data("proposal-uuid"));
            if (current_index + 1 < proposal_uuids.length) {
      Severity: Major
      Found in app/assets/javascripts/staff/program/proposals.js and 1 other location - About 7 hrs to fix
      app/assets/javascripts/staff/proposals.js on lines 43..58

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

      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

      Class WebsiteDecorator has 43 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class WebsiteDecorator < ApplicationDecorator
        delegate_all
        delegate :title, :author, :description, to: :meta_data
      
        DEFAULT_LINKS = {
      Severity: Minor
      Found in app/decorators/website_decorator.rb - About 5 hrs to fix

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

            Set3: {
              type: 'qualitative',
              cbf: 0,
              3: ['8dd3c7', 'ffffb3', 'bebada'],
              4: ['8dd3c7', 'ffffb3', 'bebada', 'fb8072'],
        Severity: Major
        Found in app/assets/javascripts/palette.js and 1 other location - About 5 hrs to fix
        app/assets/javascripts/palette.js on lines 1374..1393

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

        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

            Paired: {
              type: 'qualitative',
              cbf: 4,
              3: ['a6cee3', '1f78b4', 'b2df8a'],
              4: ['a6cee3', '1f78b4', 'b2df8a', '33a02c'],
        Severity: Major
        Found in app/assets/javascripts/palette.js and 1 other location - About 5 hrs to fix
        app/assets/javascripts/palette.js on lines 1446..1465

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

        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

        Class Proposal has 42 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Proposal < ApplicationRecord
          include Proposal::State
        
          has_many :public_comments, dependent: :destroy
          has_many :internal_comments, dependent: :destroy
        Severity: Minor
        Found in app/models/proposal.rb - About 5 hrs to fix

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

          DayView.propTypes = {
            schedule: PropTypes.object,
            dayViewing: PropTypes.number,
            startTime: PropTypes.number,
            endTime: PropTypes.number,
          Severity: Major
          Found in app/javascript/components/Schedule/DayView.js and 1 other location - About 5 hrs to fix
          app/javascript/components/Schedule/ScheduleColumn.js on lines 75..90

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

          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

          ScheduleColumn.propTypes = {
            height: PropTypes.string,
            schedule: PropTypes.object,
            dayViewing: PropTypes.number,
            startTime: PropTypes.number,
          Severity: Major
          Found in app/javascript/components/Schedule/ScheduleColumn.js and 1 other location - About 5 hrs to fix
          app/javascript/components/Schedule/DayView.js on lines 55..70

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

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

              BrBG: {
                type: 'diverging',
                cbf: 42,
                3: ['d8b365', 'f5f5f5', '5ab4ac'],
                4: ['a6611a', 'dfc27d', '80cdc1', '018571'],
          Severity: Major
          Found in app/assets/javascripts/palette.js and 8 other locations - About 4 hrs to fix
          app/assets/javascripts/palette.js on lines 1188..1205
          app/assets/javascripts/palette.js on lines 1224..1241
          app/assets/javascripts/palette.js on lines 1242..1259
          app/assets/javascripts/palette.js on lines 1260..1277
          app/assets/javascripts/palette.js on lines 1278..1295
          app/assets/javascripts/palette.js on lines 1296..1313
          app/assets/javascripts/palette.js on lines 1314..1331
          app/assets/javascripts/palette.js on lines 1332..1349

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

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

              RdBu: {
                type: 'diverging',
                cbf: 42,
                3: ['ef8a62', 'f7f7f7', '67a9cf'],
                4: ['ca0020', 'f4a582', '92c5de', '0571b0'],
          Severity: Major
          Found in app/assets/javascripts/palette.js and 8 other locations - About 4 hrs to fix
          app/assets/javascripts/palette.js on lines 1188..1205
          app/assets/javascripts/palette.js on lines 1206..1223
          app/assets/javascripts/palette.js on lines 1224..1241
          app/assets/javascripts/palette.js on lines 1242..1259
          app/assets/javascripts/palette.js on lines 1278..1295
          app/assets/javascripts/palette.js on lines 1296..1313
          app/assets/javascripts/palette.js on lines 1314..1331
          app/assets/javascripts/palette.js on lines 1332..1349

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

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

              RdYlGn: {
                type: 'diverging',
                cbf: 0,
                3: ['fc8d59', 'ffffbf', '91cf60'],
                4: ['d7191c', 'fdae61', 'a6d96a', '1a9641'],
          Severity: Major
          Found in app/assets/javascripts/palette.js and 8 other locations - About 4 hrs to fix
          app/assets/javascripts/palette.js on lines 1188..1205
          app/assets/javascripts/palette.js on lines 1206..1223
          app/assets/javascripts/palette.js on lines 1224..1241
          app/assets/javascripts/palette.js on lines 1242..1259
          app/assets/javascripts/palette.js on lines 1260..1277
          app/assets/javascripts/palette.js on lines 1278..1295
          app/assets/javascripts/palette.js on lines 1296..1313
          app/assets/javascripts/palette.js on lines 1314..1331

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

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

              PuOr: {
                type: 'diverging',
                cbf: 42,
                3: ['f1a340', 'f7f7f7', '998ec3'],
                4: ['e66101', 'fdb863', 'b2abd2', '5e3c99'],
          Severity: Major
          Found in app/assets/javascripts/palette.js and 8 other locations - About 4 hrs to fix
          app/assets/javascripts/palette.js on lines 1206..1223
          app/assets/javascripts/palette.js on lines 1224..1241
          app/assets/javascripts/palette.js on lines 1242..1259
          app/assets/javascripts/palette.js on lines 1260..1277
          app/assets/javascripts/palette.js on lines 1278..1295
          app/assets/javascripts/palette.js on lines 1296..1313
          app/assets/javascripts/palette.js on lines 1314..1331
          app/assets/javascripts/palette.js on lines 1332..1349

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

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

              PiYG: {
                type: 'diverging',
                cbf: 42,
                3: ['e9a3c9', 'f7f7f7', 'a1d76a'],
                4: ['d01c8b', 'f1b6da', 'b8e186', '4dac26'],
          Severity: Major
          Found in app/assets/javascripts/palette.js and 8 other locations - About 4 hrs to fix
          app/assets/javascripts/palette.js on lines 1188..1205
          app/assets/javascripts/palette.js on lines 1206..1223
          app/assets/javascripts/palette.js on lines 1224..1241
          app/assets/javascripts/palette.js on lines 1260..1277
          app/assets/javascripts/palette.js on lines 1278..1295
          app/assets/javascripts/palette.js on lines 1296..1313
          app/assets/javascripts/palette.js on lines 1314..1331
          app/assets/javascripts/palette.js on lines 1332..1349

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

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

              RdYlBu: {
                type: 'diverging',
                cbf: 42,
                3: ['fc8d59', 'ffffbf', '91bfdb'],
                4: ['d7191c', 'fdae61', 'abd9e9', '2c7bb6'],
          Severity: Major
          Found in app/assets/javascripts/palette.js and 8 other locations - About 4 hrs to fix
          app/assets/javascripts/palette.js on lines 1188..1205
          app/assets/javascripts/palette.js on lines 1206..1223
          app/assets/javascripts/palette.js on lines 1224..1241
          app/assets/javascripts/palette.js on lines 1242..1259
          app/assets/javascripts/palette.js on lines 1260..1277
          app/assets/javascripts/palette.js on lines 1278..1295
          app/assets/javascripts/palette.js on lines 1314..1331
          app/assets/javascripts/palette.js on lines 1332..1349

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

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

              PRGn: {
                type: 'diverging',
                cbf: 42,
                3: ['af8dc3', 'f7f7f7', '7fbf7b'],
                4: ['7b3294', 'c2a5cf', 'a6dba0', '008837'],
          Severity: Major
          Found in app/assets/javascripts/palette.js and 8 other locations - About 4 hrs to fix
          app/assets/javascripts/palette.js on lines 1188..1205
          app/assets/javascripts/palette.js on lines 1206..1223
          app/assets/javascripts/palette.js on lines 1242..1259
          app/assets/javascripts/palette.js on lines 1260..1277
          app/assets/javascripts/palette.js on lines 1278..1295
          app/assets/javascripts/palette.js on lines 1296..1313
          app/assets/javascripts/palette.js on lines 1314..1331
          app/assets/javascripts/palette.js on lines 1332..1349

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

          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