rubycentral/cfp-app

View on GitHub

Showing 126 of 126 total issues

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

    Pastel2: {
      type: 'qualitative',
      cbf: 0,
      3: ['b3e2cd', 'fdcdac', 'cbd5e8'],
      4: ['b3e2cd', 'fdcdac', 'cbd5e8', 'f4cae4'],
Severity: Major
Found in app/assets/javascripts/palette.js and 3 other locations - About 2 hrs to fix
app/assets/javascripts/palette.js on lines 1350..1361
app/assets/javascripts/palette.js on lines 1362..1373
app/assets/javascripts/palette.js on lines 1434..1445

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

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

    Accent: {
      type: 'qualitative',
      cbf: 0,
      3: ['7fc97f', 'beaed4', 'fdc086'],
      4: ['7fc97f', 'beaed4', 'fdc086', 'ffff99'],
Severity: Major
Found in app/assets/javascripts/palette.js and 3 other locations - About 2 hrs to fix
app/assets/javascripts/palette.js on lines 1362..1373
app/assets/javascripts/palette.js on lines 1408..1419
app/assets/javascripts/palette.js on lines 1434..1445

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

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

    Dark2: {
      type: 'qualitative',
      cbf: 3,
      3: ['1b9e77', 'd95f02', '7570b3'],
      4: ['1b9e77', 'd95f02', '7570b3', 'e7298a'],
Severity: Major
Found in app/assets/javascripts/palette.js and 3 other locations - About 2 hrs to fix
app/assets/javascripts/palette.js on lines 1350..1361
app/assets/javascripts/palette.js on lines 1408..1419
app/assets/javascripts/palette.js on lines 1434..1445

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

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 EventStats has 22 methods (exceeds 20 allowed). Consider refactoring.
Open

class EventStats

  attr_reader :event

  def initialize(event)
Severity: Minor
Found in app/models/event_stats.rb - About 2 hrs to fix

    Function render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        const {
          height,
          room,
          startTime,
    Severity: Major
    Found in app/javascript/components/Schedule/ScheduleColumn.js - About 2 hrs to fix

      Function render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const {
            slot,
            ripTime,
            startTime,
      Severity: Major
      Found in app/javascript/components/Schedule/ScheduleSlot.js - About 2 hrs to fix

        Class ProgramSession has 21 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class ProgramSession < ApplicationRecord
          LIVE = 'live' # confirmed accepted
          DRAFT = 'draft' # created by organizer, not ready to be published (live)
          UNCONFIRMED_ACCEPTED = 'unconfirmed accepted' # accepted, to be confirmed by speaker
          UNCONFIRMED_WAITLISTED = 'unconfirmed waitlisted'
        Severity: Minor
        Found in app/models/program_session.rb - About 2 hrs to fix

          Class EventsController has 21 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class Staff::EventsController < Staff::ApplicationController
            before_action :enable_staff_event_subnav
          
            helper_method :sticky_template_test_email
          
          
          Severity: Minor
          Found in app/controllers/staff/events_controller.rb - About 2 hrs to fix

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

                  <div
                    className="program_session_card"
                    draggable={true}
                    onDragStart={(e) => this.drag(session, e)}
                    onDragEnd={(e) => this.dragEnd(e)}
            Severity: Major
            Found in app/javascript/components/Schedule/ProgramSession.js and 1 other location - About 1 hr to fix
            app/javascript/components/Schedule/TimeSlotInfo.js on lines 18..25

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

            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

                  <div className="slot_info_card">
                    <div className="card_header" style={{ backgroundColor: bkgColor }}>
                      {trackName}
                    </div>
                    <div className="card_body">
            Severity: Major
            Found in app/javascript/components/Schedule/TimeSlotInfo.js and 1 other location - About 1 hr to fix
            app/javascript/components/Schedule/ProgramSession.js on lines 27..39

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

            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

            Function exports has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (api) {
              var validEnv = ['development', 'test', 'production'];
              var currentEnv = api.env();
              var isDevelopmentEnv = api.env('development');
              var isProductionEnv = api.env('production');
            Severity: Minor
            Found in babel.config.js - About 1 hr to fix

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

                palette.Scheme.withColorFunction = function(name, groups,
                                                            func, opt_is_cbf, opt_cyclic) {
                  var scheme = palette.Scheme(name, groups);
                  scheme.setColorFunction.apply(scheme, slice(arguments, 2));
                  return scheme;
              Severity: Major
              Found in app/assets/javascripts/palette.js and 1 other location - About 1 hr to fix
              app/assets/javascripts/palette.js on lines 445..450

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

              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

                palette.Scheme.fromPalettes = function(name, groups,
                                                       palettes, opt_max, opt_cbf_max) {
                  var scheme = palette.Scheme(name, groups);
                  scheme.addPalettes.apply(scheme, slice(arguments, 2));
                  return scheme;
              Severity: Major
              Found in app/assets/javascripts/palette.js and 1 other location - About 1 hr to fix
              app/assets/javascripts/palette.js on lines 469..474

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

              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

              Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  const {
                    dayViewing,
                    startTime,
                    endTime,
              Severity: Minor
              Found in app/javascript/components/Schedule/DayView.js - About 1 hr to fix

                Method incomplete_checklist_items has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  def incomplete_checklist_items
                    missing_items = []
                
                    missing_items << "Event must have a url" unless url.present?
                    missing_items << "Event must have a start date" unless start_date
                Severity: Minor
                Found in app/models/event.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 create_from_proposal has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  def self.create_from_proposal(proposal)
                    self.transaction do
                      ps = ProgramSession.create!(event_id: proposal.event_id,
                                                  proposal_id: proposal.id,
                                                  title: proposal.title,
                Severity: Minor
                Found in app/models/program_session.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

                    $('#time_slot_start_time').timepicker({
                      controlType: 'select',
                      timeFormat: 'h:mm tt',
                      stepMinute: 5,
                      onSelect: function(time) {
                Severity: Major
                Found in app/assets/javascripts/staff/program/time-slot.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/staff/program/time-slot.js on lines 28..36

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

                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

                    $('#time_slot_end_time').timepicker({
                      controlType: 'select',
                      timeFormat: 'h:mm tt',
                      stepMinute: 5,
                      onSelect: function(time) {
                Severity: Major
                Found in app/assets/javascripts/staff/program/time-slot.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/staff/program/time-slot.js on lines 19..27

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

                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

                Function self has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var self = function(number, varargs) {
                      number |= 0;
                      if (!number) {
                        return [];
                      }
                Severity: Minor
                Found in app/assets/javascripts/palette.js - About 1 hr to fix

                  Method website_params has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def website_params
                      params
                        .require(:website)
                        .permit(
                          :logo,
                  Severity: Minor
                  Found in app/controllers/staff/websites_controller.rb - About 1 hr to fix
                    Severity
                    Category
                    Status
                    Source
                    Language