codeRIT/hackathon_manager

View on GitHub

Showing 147 of 151 total issues

Function applyAction has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var applyAction = function() {
    $('[type=submit][data-bulk-row-edit]').prop('disabled', true);

    var ids = [];
    $('input[type=checkbox][data-bulk-row-edit]:checked').each(function() {
Severity: Minor
Found in app/assets/javascripts/manage/lib/jquery.bulkRowedit.js - About 1 hr to fix

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

      render() {
        return (
          <footer className="nav-footer" id="footer">
            <section className="sitemap">
              <a href={this.props.config.baseUrl} className="nav-home">
    Severity: Minor
    Found in website/core/Footer.js - About 1 hr to fix

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

          const PromoSection = props => (
            <div className="section promoSection">
              <div className="promoRow">
                <div className="pluginRowBlock">{props.children}</div>
              </div>
      Severity: Major
      Found in website/pages/en/index.js and 1 other location - About 1 hr to fix
      website/pages/en/index.js on lines 24..30

      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

          const SplashContainer = props => (
            <div className="homeContainer">
              <div className="homeSplashFade">
                <div className="wrapper homeWrapper">{props.children}</div>
              </div>
      Severity: Major
      Found in website/pages/en/index.js and 1 other location - About 1 hr to fix
      website/pages/en/index.js on lines 39..45

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

      var setupEmailEvents = function() {
        $('.email-events').each(function() {
          var events_container = this;
      
          $(events_container).html('<span class="fa fa-circle-o-notch fa-spin"></span>');
      Severity: Minor
      Found in app/assets/javascripts/manage/lib/emailEvents.js - About 1 hr to fix

        Method check_in has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def check_in
            respond_to do |format|
              format.json do
                if params[:check_in] == "true"
                  check_in_attendee
        Severity: Minor
        Found in app/controllers/manage/questionnaires_controller.rb - About 1 hr to fix

          Method update has a Cognitive Complexity of 14 (exceeds 7 allowed). Consider refactoring.
          Open

            def update
              # save to check if bus status changes after rsvp
              bus = @questionnaire.bus_list_id
              acc_status = @questionnaire.acc_status
          
          
          Severity: Minor
          Found in app/controllers/rsvps_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 Help has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function Help(props) {
            const {config: siteConfig, language = ''} = props;
            const {baseUrl, docsUrl} = siteConfig;
            const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
            const langPart = `${language ? `${language}/` : ''}`;
          Severity: Minor
          Found in website/pages/en/help.js - About 1 hr to fix

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

                var validateAll = function() {
                  var success = true,
                    invalid_inputs = [],
                    first_input;
                  $(this)
            Severity: Minor
            Found in app/assets/javascripts/validate.js - About 1 hr to fix

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

                function ready(error, us) {
                  if (error) return console.error(error);
              
                  svg
                    .append('path')
              Severity: Minor
              Found in app/assets/javascripts/manage/map.js - About 1 hr to fix

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

                    const BusLists = () => (
                      <Block background="light">
                        {[
                          {
                            content:
                Severity: Major
                Found in website/pages/en/index.js and 2 other locations - About 1 hr to fix
                website/pages/en/index.js on lines 131..143
                website/pages/en/index.js on lines 187..199

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

                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

                    const EmailCommunication = () => (
                      <Block background="light">
                        {[
                          {
                            content:
                Severity: Major
                Found in website/pages/en/index.js and 2 other locations - About 1 hr to fix
                website/pages/en/index.js on lines 131..143
                website/pages/en/index.js on lines 159..171

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

                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

                    const Applications = () => (
                      <Block background="light">
                        {[
                          {
                            content:
                Severity: Major
                Found in website/pages/en/index.js and 2 other locations - About 1 hr to fix
                website/pages/en/index.js on lines 159..171
                website/pages/en/index.js on lines 187..199

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

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

                var setupHighcharts = function() {
                  Highcharts.setOptions({
                    global: {
                      useUTC: false,
                    },
                Severity: Minor
                Found in app/assets/javascripts/manage/lib/setupHighcharts.js - About 1 hr to fix

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

                    def update
                      # save to check if bus status changes after rsvp
                      bus = @questionnaire.bus_list_id
                      acc_status = @questionnaire.acc_status
                  
                  
                  Severity: Minor
                  Found in app/controllers/rsvps_controller.rb - About 1 hr to fix

                    Method new has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def new
                        if current_user.questionnaire.present?
                          return redirect_to questionnaires_path
                        end
                        @questionnaire = Questionnaire.new
                    Severity: Minor
                    Found in app/controllers/questionnaires_controller.rb - About 1 hr to fix

                      Block has too many lines. [35/25]
                      Open

                          respond_to do |format|
                            format.json do
                              if params[:check_in] == "true"
                                check_in_attendee
                              elsif params[:check_in] == "false"

                      This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

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

                      function eventCalendar() {
                        return $('#calendar').fullCalendar({
                          defaultView: 'listYear',
                          buttonText: {
                            today: 'Today'
                      Severity: Minor
                      Found in app/assets/javascripts/events.js - About 1 hr to fix

                        Function setupManageForms has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var setupManageForms = function() {
                          var disable = function($element) {
                            $element.hide();
                            $element.find('input').prop('disabled', true);
                          };
                        Severity: Minor
                        Found in app/assets/javascripts/manage/lib/forms.js - About 1 hr to fix

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

                              const StatisticsVisualization = () => (
                                <Block>
                                  {[
                                    {
                                      content:
                          Severity: Major
                          Found in website/pages/en/index.js and 2 other locations - About 1 hr to fix
                          website/pages/en/index.js on lines 145..157
                          website/pages/en/index.js on lines 173..185

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

                          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