lighthouse-labs/laser_shark

View on GitHub

Showing 46 of 46 total issues

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

    lectureFeedbackContainer.highcharts({
      chart: {
        zoomType: 'x',
        type: 'spline'
      },
Severity: Major
Found in app/assets/javascripts/admin/teacher_stats.js and 1 other location - About 2 days to fix
app/assets/javascripts/admin/teacher_stats.js on lines 21..93

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

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

    mentorFeedbackContainer.highcharts({
      chart: {
        zoomType: 'x',
        type: 'spline'
      },
Severity: Major
Found in app/assets/javascripts/admin/teacher_stats.js and 1 other location - About 2 days to fix
app/assets/javascripts/admin/teacher_stats.js on lines 95..167

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

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

File jquery.raty.js has 574 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery Raty - A Star Rating Plugin
 *
 * The MIT License
 *
Severity: Major
Found in app/assets/javascripts/jquery.raty.js - About 1 day to fix

    Function gCalReader has 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      $.fn.gCalReader = function(options) {
        var $div = $(this);
    
        var defaults = $.extend({
            calendarId: 'en.canadian#holiday@group.v.calendar.google.com',
    Severity: Major
    Found in app/assets/javascripts/calendar_index.js - About 4 hrs to fix

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

        renderCodeReviews: function() {
          var that = this;
          if(this.props.codeReviews.length > 0)
            return this.props.codeReviews.map(function(codeReview) {
              return <CodeReview codeReview={codeReview} key={codeReview.id} location={that.props.location} />
      Severity: Major
      Found in app/assets/javascripts/components/request_queue_items.js.jsx and 1 other location - About 4 hrs to fix
      app/assets/javascripts/components/request_queue_items.js.jsx on lines 21..29

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

      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

        renderRequests: function() {
          var that = this;
          if(this.props.requests.length > 0)
            return this.props.requests.map(function(request) {
              return <Request request={request} key={request.id} location={that.props.location} />
      Severity: Major
      Found in app/assets/javascripts/components/request_queue_items.js.jsx and 1 other location - About 4 hrs to fix
      app/assets/javascripts/components/request_queue_items.js.jsx on lines 43..51

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

      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

              <p>
                <a className="btn btn-primary btn-lg" onClick={this.startAssisting} disabled={this.state.disabled}>Start Reviewing</a>
                &nbsp;
                <a className="btn btn-danger btn-lg" onClick={this.cancelAssistance} disabled={this.state.disabled}>Remove from queue</a>
              </p>
      Severity: Major
      Found in app/assets/javascripts/components/code_review.js.jsx and 1 other location - About 3 hrs to fix
      app/assets/javascripts/components/request.js.jsx on lines 34..38

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

      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

              <p>
                <a className="btn btn-primary btn-lg" onClick={this.startAssisting} disabled={this.state.disabled}>Start Assisting</a>
                &nbsp;
                <a className="btn btn-danger btn-lg" onClick={this.cancelAssistance} disabled={this.state.disabled}>Remove from queue</a>
              </p>
      Severity: Major
      Found in app/assets/javascripts/components/request.js.jsx and 1 other location - About 3 hrs to fix
      app/assets/javascripts/components/code_review.js.jsx on lines 55..59

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 100.

      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

      RequestQueue has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      var RequestQueue = React.createClass({
      
        propTypes: {
          locations: React.PropTypes.array.isRequired,
          user: React.PropTypes.object.isRequired
      Severity: Minor
      Found in app/assets/javascripts/components/request_queue.js.jsx - About 2 hrs to fix

        File request_queue.js.jsx has 273 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        var RequestQueue = React.createClass({
        
          propTypes: {
            locations: React.PropTypes.array.isRequired,
            user: React.PropTypes.object.isRequired
        Severity: Minor
        Found in app/assets/javascripts/components/request_queue.js.jsx - About 2 hrs to fix

          Function subscribeToSocket has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            subscribeToSocket: function() {
              var that = this;
              if(App.assistance)
                App.assistance.unsubscribe();
          
          
          Severity: Major
          Found in app/assets/javascripts/components/request_queue.js.jsx - About 2 hrs to fix

            Function value has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                value: function(target) {
                  'use strict';
                  if (target === undefined || target === null) {
                    throw new TypeError('Cannot convert first argument to object');
                  }
            Severity: Minor
            Found in app/assets/javascripts/polyfills/object_assign.js - About 2 hrs to fix

            Cognitive Complexity

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

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

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

            Further reading

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

            class User < ActiveRecord::Base
            
              mount_uploader :custom_avatar, CustomAvatarUploader
            
              belongs_to :cohort
            Severity: Minor
            Found in app/models/user.rb - About 2 hrs to fix

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

                render: function() {
                  var assistance = this.props.assistance;
              
                  if(assistance)
                    var assistanceRequest = assistance.assistance_request;
              Severity: Minor
              Found in app/assets/javascripts/components/request_modal.js.jsx - About 1 hr to fix

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

                          <p>
                            <b>Submission URL:</b>
                            <a target="_blank" href={assistanceRequest.activity_submission.github_url}>
                              {assistanceRequest.activity_submission.github_url}
                            </a>
                Severity: Major
                Found in app/assets/javascripts/components/assistance.js.jsx and 1 other location - About 1 hr to fix
                app/assets/javascripts/components/code_review.js.jsx on lines 31..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 70.

                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

                          <p>
                            <b>Submission URL:</b> 
                            <a target="_blank" href={codeReview.activity_submission.github_url}>
                              {codeReview.activity_submission.github_url}
                            </a>
                Severity: Major
                Found in app/assets/javascripts/components/code_review.js.jsx and 1 other location - About 1 hr to fix
                app/assets/javascripts/components/assistance.js.jsx on lines 35..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 70.

                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

                  getRequestIndex: function(assistanceRequest) {
                    var requests = this.state.requests;
                    var ids = requests.map(function(r){
                      return r.id;
                    });
                Severity: Major
                Found in app/assets/javascripts/components/request_queue.js.jsx and 1 other location - About 1 hr to fix
                app/assets/javascripts/components/request_queue.js.jsx on lines 251..258

                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

                  getStudentIndex: function(student) {
                    var students = this.state.students;
                    var ids = students.map(function(s){
                      return s.id;
                    });
                Severity: Major
                Found in app/assets/javascripts/components/request_queue.js.jsx and 1 other location - About 1 hr to fix
                app/assets/javascripts/components/request_queue.js.jsx on lines 242..249

                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

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

                      for (var i = 0; i < this.opt.number; i++) {
                        this.stars[i].title = methods._getHint.call(this, i + 1);
                      }
                Severity: Major
                Found in app/assets/javascripts/jquery.raty.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.raty.js on lines 577..579

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

                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

                      for (var i = 0; i < this.opt.number; i++) {
                        this.stars[i].title = methods._getHint.call(this, i + 1);
                      }
                Severity: Major
                Found in app/assets/javascripts/jquery.raty.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.raty.js on lines 465..467

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

                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