ophrescue/RescueRails

View on GitHub

Showing 95 of 254 total issues

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

                    dd: [ "0[1-9]|[12][0-9]|3[01]", Date.prototype.setDate, "day", function() {
                        return y(Date.prototype.getDate.call(this), 2);
                    } ],
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js and 8 other locations - About 35 mins to fix
app/assets/javascripts/jquery.inputmask.js on lines 471..473
app/assets/javascripts/jquery.inputmask.js on lines 474..476
app/assets/javascripts/jquery.inputmask.js on lines 478..480
app/assets/javascripts/jquery.inputmask.js on lines 487..489
app/assets/javascripts/jquery.inputmask.js on lines 498..500
app/assets/javascripts/jquery.inputmask.js on lines 502..504
app/assets/javascripts/jquery.inputmask.js on lines 505..507
app/assets/javascripts/jquery.inputmask.js on lines 508..510

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

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

                    HH: [ "0[0-9]|1[0-9]|2[0-3]", Date.prototype.setHours, "hours", function() {
                        return y(Date.prototype.getHours.call(this), 2);
                    } ],
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js and 8 other locations - About 35 mins to fix
app/assets/javascripts/jquery.inputmask.js on lines 458..460
app/assets/javascripts/jquery.inputmask.js on lines 471..473
app/assets/javascripts/jquery.inputmask.js on lines 474..476
app/assets/javascripts/jquery.inputmask.js on lines 478..480
app/assets/javascripts/jquery.inputmask.js on lines 498..500
app/assets/javascripts/jquery.inputmask.js on lines 502..504
app/assets/javascripts/jquery.inputmask.js on lines 505..507
app/assets/javascripts/jquery.inputmask.js on lines 508..510

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

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

                    L: [ "[0-9]{2}", Date.prototype.setMilliseconds, "milliseconds", function() {
                        return y(Date.prototype.getMilliseconds.call(this), 2);
                    } ],
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js and 8 other locations - About 35 mins to fix
app/assets/javascripts/jquery.inputmask.js on lines 458..460
app/assets/javascripts/jquery.inputmask.js on lines 471..473
app/assets/javascripts/jquery.inputmask.js on lines 474..476
app/assets/javascripts/jquery.inputmask.js on lines 478..480
app/assets/javascripts/jquery.inputmask.js on lines 487..489
app/assets/javascripts/jquery.inputmask.js on lines 498..500
app/assets/javascripts/jquery.inputmask.js on lines 502..504
app/assets/javascripts/jquery.inputmask.js on lines 505..507

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

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

                    hh: [ "0[1-9]|1[0-2]", Date.prototype.setHours, "hours", function() {
                        return y(Date.prototype.getHours.call(this), 2);
                    } ],
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js and 8 other locations - About 35 mins to fix
app/assets/javascripts/jquery.inputmask.js on lines 458..460
app/assets/javascripts/jquery.inputmask.js on lines 471..473
app/assets/javascripts/jquery.inputmask.js on lines 474..476
app/assets/javascripts/jquery.inputmask.js on lines 487..489
app/assets/javascripts/jquery.inputmask.js on lines 498..500
app/assets/javascripts/jquery.inputmask.js on lines 502..504
app/assets/javascripts/jquery.inputmask.js on lines 505..507
app/assets/javascripts/jquery.inputmask.js on lines 508..510

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

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

                    MM: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setMinutes, "minutes", function() {
                        return y(Date.prototype.getMinutes.call(this), 2);
                    } ],
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js and 8 other locations - About 35 mins to fix
app/assets/javascripts/jquery.inputmask.js on lines 458..460
app/assets/javascripts/jquery.inputmask.js on lines 471..473
app/assets/javascripts/jquery.inputmask.js on lines 474..476
app/assets/javascripts/jquery.inputmask.js on lines 478..480
app/assets/javascripts/jquery.inputmask.js on lines 487..489
app/assets/javascripts/jquery.inputmask.js on lines 502..504
app/assets/javascripts/jquery.inputmask.js on lines 505..507
app/assets/javascripts/jquery.inputmask.js on lines 508..510

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

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

                    yy: [ "[0-9]{2}", Date.prototype.setFullYear, "year", function() {
                        return y(Date.prototype.getFullYear.call(this), 2);
                    } ],
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js and 8 other locations - About 35 mins to fix
app/assets/javascripts/jquery.inputmask.js on lines 458..460
app/assets/javascripts/jquery.inputmask.js on lines 474..476
app/assets/javascripts/jquery.inputmask.js on lines 478..480
app/assets/javascripts/jquery.inputmask.js on lines 487..489
app/assets/javascripts/jquery.inputmask.js on lines 498..500
app/assets/javascripts/jquery.inputmask.js on lines 502..504
app/assets/javascripts/jquery.inputmask.js on lines 505..507
app/assets/javascripts/jquery.inputmask.js on lines 508..510

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

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

                    ss: [ "0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]", Date.prototype.setSeconds, "seconds", function() {
                        return y(Date.prototype.getSeconds.call(this), 2);
                    } ],
Severity: Major
Found in app/assets/javascripts/jquery.inputmask.js and 8 other locations - About 35 mins to fix
app/assets/javascripts/jquery.inputmask.js on lines 458..460
app/assets/javascripts/jquery.inputmask.js on lines 471..473
app/assets/javascripts/jquery.inputmask.js on lines 474..476
app/assets/javascripts/jquery.inputmask.js on lines 478..480
app/assets/javascripts/jquery.inputmask.js on lines 487..489
app/assets/javascripts/jquery.inputmask.js on lines 498..500
app/assets/javascripts/jquery.inputmask.js on lines 505..507
app/assets/javascripts/jquery.inputmask.js on lines 508..510

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

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

  def show
    session[:last_cat_manager_search] ||= cats_manager_index_url
    @title = @cat.name
    @og_image_path = @cat.primary_photo_url
    @carousel = Carousel.new(@cat)
Severity: Minor
Found in app/controllers/cats/cats_base_controller.rb and 1 other location - About 35 mins to fix
app/controllers/dogs/dogs_base_controller.rb on lines 68..74

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

  def show
    session[:last_dog_manager_search] ||= dogs_manager_index_url
    @title = @dog.name
    @og_image_path = @dog.primary_photo_url
    @carousel = Carousel.new(@dog)
Severity: Minor
Found in app/controllers/dogs/dogs_base_controller.rb and 1 other location - About 35 mins to fix
app/controllers/cats/cats_base_controller.rb on lines 18..24

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

  def create
    @cat = Cat.new(cat_params)
    @cat.tracking_id = Cat.next_tracking_id if @cat.tracking_id.blank?

    if @cat.save
Severity: Minor
Found in app/controllers/cats/manager_controller.rb and 1 other location - About 30 mins to fix
app/controllers/dogs/manager_controller.rb on lines 114..124

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

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

  def create
    @dog = Dog.new(dog_params)
    @dog.tracking_id = Dog.next_tracking_id if @dog.tracking_id.blank?

    if @dog.save
Severity: Minor
Found in app/controllers/dogs/manager_controller.rb and 1 other location - About 30 mins to fix
app/controllers/cats/manager_controller.rb on lines 64..74

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

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

  if (otherPetsRadio.checked === true){
    document.getElementById('other-pets-questions').classList.remove('collapse')
    makeHasPetsQuestionsRequired(true)
  }
Severity: Major
Found in app/javascript/packs/volunteer_app.js and 3 other locations - About 30 mins to fix
app/javascript/packs/volunteer_app.js on lines 51..54
app/javascript/packs/volunteer_app.js on lines 56..59
app/javascript/packs/volunteer_app.js on lines 65..68

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

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

  if (rentRadio.checked === true ) {
    document.getElementById('foster-rental-questions').classList.remove('collapse')
    makeRentalQuestionsRequired(true)
  }
Severity: Major
Found in app/javascript/packs/volunteer_app.js and 3 other locations - About 30 mins to fix
app/javascript/packs/volunteer_app.js on lines 51..54
app/javascript/packs/volunteer_app.js on lines 61..64
app/javascript/packs/volunteer_app.js on lines 65..68

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

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

  if (dogsToggle.checked === true){
    document.getElementById('dog-foster-questions').classList.remove('collapse')
    makeDogFosterQuestionsRequired(true)
  }
Severity: Major
Found in app/javascript/packs/volunteer_app.js and 3 other locations - About 30 mins to fix
app/javascript/packs/volunteer_app.js on lines 51..54
app/javascript/packs/volunteer_app.js on lines 56..59
app/javascript/packs/volunteer_app.js on lines 61..64

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

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

  if (fosterToggle.checked === true) {
    document.getElementById('foster-questions').classList.remove('collapse')
    makeFosterQuestionsRequired(true)
  }
Severity: Major
Found in app/javascript/packs/volunteer_app.js and 3 other locations - About 30 mins to fix
app/javascript/packs/volunteer_app.js on lines 56..59
app/javascript/packs/volunteer_app.js on lines 61..64
app/javascript/packs/volunteer_app.js on lines 65..68

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

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