fiedl/your_platform

View on GitHub

Showing 251 of 251 total issues

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

  create_table "decision_making_signatures", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t|
    t.integer  "user_id"
    t.string   "signable_type"
    t.string   "signable_id"
    t.string   "verified_by"
Severity: Minor
Found in demo_app/my_platform/db/schema.rb and 1 other location - About 35 mins to fix
demo_app/my_platform/db/schema.rb on lines 154..161

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

  create_table "bookmarks", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t|
    t.integer  "bookmarkable_id"
    t.string   "bookmarkable_type"
    t.integer  "user_id"
    t.datetime "created_at"
Severity: Minor
Found in demo_app/my_platform/db/schema.rb and 1 other location - About 35 mins to fix
demo_app/my_platform/db/schema.rb on lines 621..628

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 change
    create_table :requests do |t|
      t.integer :user_id
      t.string :ip
      t.string :method
demo_app/my_platform/db/migrate/20170114221016_create_term_infos.your_platform.rb on lines 3..14

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 change
    create_table :term_infos do |t|
      t.integer :term_id
      t.integer :corporation_id
      t.integer :number_of_members
demo_app/my_platform/db/migrate/20170327234550_create_requests.your_platform.rb on lines 3..14

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 method.
Open

    return []
Severity: Major
Found in app/models/role.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

        return t :events
    Severity: Major
    Found in app/helpers/events_helper.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

            return false
      Severity: Major
      Found in app/models/post_delivery.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return 'guest' if guest?
        Severity: Major
        Found in app/models/role.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return 'member' if member?
          Severity: Major
          Found in app/models/role.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                return t :all_events if @all
            Severity: Major
            Found in app/helpers/events_helper.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                  return 'deceased_member' if deceased_member?
              Severity: Major
              Found in app/models/role.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                    return 'full_member' if full_member?
                Severity: Major
                Found in app/models/role.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                      return ['global_officer', 'user', 'public'] if global_officer?
                  Severity: Major
                  Found in app/models/role.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                        return ''
                    Severity: Major
                    Found in app/models/role.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                          return 'former_member' if former_member?
                      Severity: Major
                      Found in app/models/role.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                              return 7.pt
                        Severity: Major
                        Found in app/pdfs/address_labels_pdf.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return 10.pt if num_of_lines_required(str, 10.pt) < 6
                          Severity: Major
                          Found in app/pdfs/address_labels_pdf.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return 12.pt if num_of_lines_required(str, 12.pt) < 5
                            Severity: Major
                            Found in app/pdfs/address_labels_pdf.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return 8.pt if num_of_lines_required(str, 8.pt) < 8
                              Severity: Major
                              Found in app/pdfs/address_labels_pdf.rb - About 30 mins to fix

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

                                  create_table "navable_visits", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci" do |t|
                                    t.integer  "navable_id"
                                    t.string   "navable_type"
                                    t.integer  "group_id"
                                    t.datetime "created_at",   null: false
                                Severity: Minor
                                Found in demo_app/my_platform/db/schema.rb and 1 other location - About 25 mins to fix
                                demo_app/my_platform/db/schema.rb on lines 69..75

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

                                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