rubycentral/cfp-app

View on GitHub

Showing 126 of 126 total issues

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

  render() {
    const { sessions, unscheduledSessions, tracks } = this.props;
    const { searchInput, isHidden } = this.state;
    let display = isHidden ? 'none' : '';
    let filteredSessions = unscheduledSessions.filter((session) => {
Severity: Minor
Found in app/javascript/components/Schedule/UnscheduledArea.js - About 1 hr to fix

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

            <label>
              Title:
              <input type="text" name="title" value={this.props.title} onChange={this.props.updateSlot} />
            </label>
    Severity: Major
    Found in app/javascript/components/Schedule/TimeSlotModal.js and 2 other locations - About 1 hr to fix
    app/javascript/components/Schedule/TimeSlotModal.js on lines 128..131
    app/javascript/components/Schedule/TimeSlotModal.js on lines 132..135

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

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

            <label>
              Presenter:
              <input type="text" name="presenter" value={this.props.presenter} onChange={this.props.updateSlot} />
            </label>
    Severity: Major
    Found in app/javascript/components/Schedule/TimeSlotModal.js and 2 other locations - About 1 hr to fix
    app/javascript/components/Schedule/TimeSlotModal.js on lines 113..116
    app/javascript/components/Schedule/TimeSlotModal.js on lines 132..135

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

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

            <label>
              Description:
              <textarea type="text" name="description" value={this.props.description} onChange={this.props.updateSlot} />
            </label>
    Severity: Major
    Found in app/javascript/components/Schedule/TimeSlotModal.js and 2 other locations - About 1 hr to fix
    app/javascript/components/Schedule/TimeSlotModal.js on lines 113..116
    app/javascript/components/Schedule/TimeSlotModal.js on lines 128..131

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

    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 initTimeSlot has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function initTimeSlot($slot) {
        $slot.css({
          height: ($slot.data('duration') * verticalScale) + 'px',
          top: (($slot.data('starts') - dayStart) * verticalScale) + 'px'
        });
    Severity: Minor
    Found in app/assets/javascripts/staff/program/grid.js - About 1 hr to fix

      Function initialize has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        initialize () {
          this.tinyMCEDefaults = {
            height: 500,
            menubar: false,
            plugins: [
      Severity: Minor
      Found in app/javascript/controllers/editor_controller.js - About 1 hr to fix

        Method after_sign_in_path_for has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

          def after_sign_in_path_for(user)
            if session[:pending_invite_accept_url]
              session[:pending_invite_accept_url]
            elsif !user.complete?
              edit_profile_path
        Severity: Minor
        Found in app/controllers/application_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

        Function listSchemes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          palette.listSchemes = function(name, opt_number) {
            if (!opt_number) {
              opt_number = 2;
            } else if (opt_number < 0) {
              opt_number = -opt_number;
        Severity: Minor
        Found in app/assets/javascripts/palette.js - About 1 hr to fix

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

              editor.on('drop', (e, event) => {
                event.preventDefault();
                this.uploadFile(event.dataTransfer.files[0], event, e)
              })
          Severity: Minor
          Found in app/javascript/controllers/editor_controller.js and 1 other location - About 55 mins to fix
          app/javascript/controllers/content_controller.js on lines 13..16

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

          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

              editor.on('drop', (e, event) => {
                event.preventDefault();
                this.uploadFile(event.dataTransfer.files[0], event, e)
              })
          Severity: Minor
          Found in app/javascript/controllers/content_controller.js and 1 other location - About 55 mins to fix
          app/javascript/controllers/editor_controller.js on lines 62..65

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

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

            def embed(body)
              body.tap do |body|
                TAGS.each do |tag, template|
                  body.gsub!(tag) do
                    args = tag.is_a?(Regexp) ? extract($1) : {}
          Severity: Minor
          Found in app/helpers/page_helper.rb - About 55 mins to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Method from_omniauth has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.from_omniauth(auth, invitation_email=nil)
              where(provider: auth.provider, uid: auth.uid).first_or_create do |user|
                password = Devise.friendly_token[0,20]
                user.name = auth['info']['name'] if user.name.blank?
                user.email = invitation_email || auth['info']['email'] || '' if user.email.blank?
          Severity: Minor
          Found in app/models/user.rb - About 45 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

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

            $('#edit-format-icon').click(function() {
              $('#current-format').hide();
              $('#edit-format-wrapper').show();
            });
          Severity: Major
          Found in app/assets/javascripts/proposal.js and 2 other locations - About 45 mins to fix
          app/assets/javascripts/proposal.js on lines 29..32
          app/assets/javascripts/proposal.js on lines 51..54

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

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

            def set_cache_headers
              return unless Rails.configuration.action_controller.perform_caching
          
              server_cache_age =
                current_website.caching_off? ? 0 : ENV.fetch('CACHE_CONTROL_S_MAXAGE', 1.week)
          Severity: Minor
          Found in app/controllers/application_controller.rb - About 45 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

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

                if (this.ripTime(slot.start_time) < hours.startTime) {
                  hours.startTime = this.ripTime(slot.start_time);
                }
          Severity: Minor
          Found in app/javascript/components/Schedule.js and 1 other location - About 45 mins to fix
          app/javascript/components/Schedule.js on lines 55..57

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

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

            $('#edit-track-icon').click(function() {
              $('#current-track').hide();
              $('#edit-track-wrapper').show();
            });
          Severity: Major
          Found in app/assets/javascripts/proposal.js and 2 other locations - About 45 mins to fix
          app/assets/javascripts/proposal.js on lines 40..43
          app/assets/javascripts/proposal.js on lines 51..54

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

          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

                if (this.ripTime(slot.end_time) > hours.endTime) {
                  hours.endTime = this.ripTime(slot.end_time);
                }
          Severity: Minor
          Found in app/javascript/components/Schedule.js and 1 other location - About 45 mins to fix
          app/javascript/components/Schedule.js on lines 52..54

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

          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

            $('#cancel-track-editing').click(function() {
              $('#edit-track-wrapper').hide();
              $('#current-track').show();
            });
          Severity: Minor
          Found in app/assets/javascripts/proposal.js and 1 other location - About 45 mins to fix
          app/assets/javascripts/proposal.js on lines 45..48

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

          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

            $('#cancel-format-editing').click(function() {
              $('#edit-format-wrapper').hide();
              $('#current-format').show();
            });
          Severity: Minor
          Found in app/assets/javascripts/proposal.js and 1 other location - About 45 mins to fix
          app/assets/javascripts/proposal.js on lines 34..37

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

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

            $('#edit-tags-icon').click(function() {
              $('.proposal-reviewer-tags, #edit-tags-icon').toggle();
              $('#review-tags-form-wrapper').slideToggle();
            });
          Severity: Major
          Found in app/assets/javascripts/proposal.js and 2 other locations - About 45 mins to fix
          app/assets/javascripts/proposal.js on lines 29..32
          app/assets/javascripts/proposal.js on lines 40..43

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

          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