hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

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

  def update
    anime = Anime.find(params[:id])
    version = anime.create_pending(current_user, full_anime_params)
    return error!(version.item.errors.full_messages, 400) unless version.persisted?
    # if this user is admin, apply the changes
Severity: Minor
Found in app/controllers/full_anime_controller.rb and 1 other location - About 30 mins to fix
app/controllers/full_manga_controller.rb on lines 7..15

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 alternate_title(preference = '')
    if preference.class == User
      preference = preference.title_language_preference
    end

Severity: Minor
Found in app/models/anime.rb and 1 other location - About 30 mins to fix
app/models/anime.rb on lines 153..164

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 update
    manga = Manga.find(params[:id])
    version = manga.create_pending(current_user, full_manga_params)
    return error!(version.item.errors.full_messages, 400) unless version.persisted?
    # if this user is admin, apply the changes
Severity: Minor
Found in app/controllers/full_manga_controller.rb and 1 other location - About 30 mins to fix
app/controllers/full_anime_controller.rb on lines 9..17

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 canonical_title(preference = '')
    if preference.class == User
      preference = preference.title_language_preference
    end

Severity: Minor
Found in app/models/anime.rb and 1 other location - About 30 mins to fix
app/models/anime.rb on lines 170..181

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

Avoid too many return statements within this function.
Open

        return false;
Severity: Major
Found in app/assets/javascripts/old/underscore-1.4.4.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return false;
    Severity: Major
    Found in public/2014/assets/js/fastclick.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return -1;
      Severity: Major
      Found in app/assets/javascripts/old/underscore-1.4.4.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return true;
        Severity: Major
        Found in public/2013/assets/js/fastclick.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return false;
          Severity: Major
          Found in public/2013/assets/js/fastclick.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return true;
            Severity: Major
            Found in public/2014/assets/js/fastclick.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    if (aStack[length] == a) return bStack[length] == b;
              Severity: Major
              Found in app/assets/javascripts/old/underscore-1.4.4.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return false;
                Severity: Major
                Found in public/2013/assets/js/fastclick.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return;
                  Severity: Major
                  Found in app/assets/javascripts/old/garlic.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return false;
                    Severity: Major
                    Found in public/2014/assets/js/fastclick.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return true;
                      Severity: Major
                      Found in public/2014/assets/js/fastclick.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return false;
                        Severity: Major
                        Found in public/2014/assets/js/fastclick.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return true;
                          Severity: Major
                          Found in public/2014/assets/js/fastclick.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                    return true;
                            Severity: Major
                            Found in public/2013/assets/js/fastclick.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return result;
                              Severity: Major
                              Found in app/assets/javascripts/old/underscore-1.4.4.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return false;
                                Severity: Major
                                Found in public/2013/assets/js/fastclick.js - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language