epicodus/epicenter

View on GitHub

Showing 9 of 53 total issues

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

  $('#student_probation_advisor').change(function() {
    var prompt = this.checked ? 'Are you sure you want to put this student on Academic Warning (ADVISOR)?' : 'Remove student from Academic Warning (ADVISOR)?'
    var confirmed = confirm(prompt);
    if (confirmed) {
      this.form.submit();
Severity: Major
Found in app/assets/javascripts/probation.js and 1 other location - About 3 hrs to fix
app/assets/javascripts/probation.js on lines 2..10

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

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

  $('#student_probation_teacher').change(function() {
    var prompt = this.checked ? 'Are you sure you want to put this student on Academic Warning (TEACHER)?' : 'Remove student from Academic Warning (TEACHER)?'
    var confirmed = confirm(prompt);
    if (confirmed) {
      this.form.submit();
Severity: Major
Found in app/assets/javascripts/probation.js and 1 other location - About 3 hrs to fix
app/assets/javascripts/probation.js on lines 12..20

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

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

  $('.survey-code-reviews-datatable').DataTable({
    paging: false,
    autoWidth: false,
    searching: false,
    info: false,
Severity: Major
Found in app/assets/javascripts/datatable.js and 4 other locations - About 35 mins to fix
app/assets/javascripts/datatable.js on lines 40..46
app/assets/javascripts/datatable.js on lines 48..54
app/assets/javascripts/datatable.js on lines 56..62
app/assets/javascripts/datatable.js on lines 64..70

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

  $('.pair-evaluations-datatable').DataTable({
    paging: false,
    autoWidth: false,
    info: false,
    searching: false,
Severity: Major
Found in app/assets/javascripts/datatable.js and 4 other locations - About 35 mins to fix
app/assets/javascripts/datatable.js on lines 40..46
app/assets/javascripts/datatable.js on lines 48..54
app/assets/javascripts/datatable.js on lines 56..62
app/assets/javascripts/datatable.js on lines 72..78

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

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

  $('.student-internship-rankings-datatable').DataTable({
    paging: false,
    autoWidth: false,
    info: false,
    searching: false,
Severity: Major
Found in app/assets/javascripts/datatable.js and 4 other locations - About 35 mins to fix
app/assets/javascripts/datatable.js on lines 48..54
app/assets/javascripts/datatable.js on lines 56..62
app/assets/javascripts/datatable.js on lines 64..70
app/assets/javascripts/datatable.js on lines 72..78

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

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

  $('.code-review-report-datatable').DataTable({
    paging: false,
    autoWidth: false,
    info: false,
    searching: false,
Severity: Major
Found in app/assets/javascripts/datatable.js and 4 other locations - About 35 mins to fix
app/assets/javascripts/datatable.js on lines 40..46
app/assets/javascripts/datatable.js on lines 48..54
app/assets/javascripts/datatable.js on lines 64..70
app/assets/javascripts/datatable.js on lines 72..78

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

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

            cohort_confirmation_message = @student.reload.cohort == @previous_current_cohort ? "Current cohort has not been changed." : "Current cohort has been set to #{@student.cohort.try(:description) || 'blank'}."
            flash[:notice] = @confirmation_message + "<br>" + cohort_confirmation_message
            render js: "window.location.pathname ='#{student_courses_path(@student)}'"
          end
Severity: Minor
Found in app/controllers/enrollments_controller.rb and 1 other location - About 35 mins to fix
app/controllers/enrollments_controller.rb on lines 27..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 34.

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

  $('.daily-submissions-datatable').DataTable({
    paging: false,
    autoWidth: false,
    info: false,
    searching: false,
Severity: Major
Found in app/assets/javascripts/datatable.js and 4 other locations - About 35 mins to fix
app/assets/javascripts/datatable.js on lines 40..46
app/assets/javascripts/datatable.js on lines 56..62
app/assets/javascripts/datatable.js on lines 64..70
app/assets/javascripts/datatable.js on lines 72..78

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

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

          cohort_confirmation_message = @student.reload.cohort == @previous_current_cohort ? "Current cohort has not been changed." : "Current cohort has been set to #{@student.cohort.try(:description) || 'blank'}."
          flash[:notice] = @confirmation_message + "<br>" + cohort_confirmation_message
          render js: "window.location.pathname ='#{student_courses_path(@student)}'"
        end
Severity: Minor
Found in app/controllers/enrollments_controller.rb and 1 other location - About 35 mins to fix
app/controllers/enrollments_controller.rb on lines 53..56

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

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