KentaaNL/kentaa-api

View on GitHub

Showing 40 of 56 total issues

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

        def entity
          if action_id
            Kentaa::Api::Resources::Action.new(config, id: action_id, options: options)
          elsif team_id
            Kentaa::Api::Resources::Team.new(config, id: team_id, options: options)
Severity: Major
Found in lib/kentaa/api/resources/donation.rb and 1 other location - About 2 hrs to fix
lib/kentaa/api/resources/manual_donation.rb on lines 14..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 91.

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

        def entity
          if action_id
            Kentaa::Api::Resources::Action.new(config, id: action_id, options: options)
          elsif team_id
            Kentaa::Api::Resources::Team.new(config, id: team_id, options: options)
Severity: Major
Found in lib/kentaa/api/resources/manual_donation.rb and 1 other location - About 2 hrs to fix
lib/kentaa/api/resources/donation.rb on lines 14..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 91.

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

module Kentaa
  module Api
    module Resources
      class Video
        attr_reader :data
Severity: Minor
Found in lib/kentaa/api/resources/video.rb and 1 other location - About 50 mins to fix
lib/kentaa/api/resources/photo.rb on lines 5..28

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

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

module Kentaa
  module Api
    module Resources
      class Photo
        attr_reader :data
Severity: Minor
Found in lib/kentaa/api/resources/photo.rb and 1 other location - About 50 mins to fix
lib/kentaa/api/resources/video.rb on lines 5..28

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

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

        def parent
          if project_id
            Kentaa::Api::Resources::Project.new(config, id: project_id, options: options)
          elsif segment_id
            Kentaa::Api::Resources::Segment.new(config, id: segment_id, options: options)
Severity: Minor
Found in lib/kentaa/api/resources/team.rb and 1 other location - About 45 mins to fix
lib/kentaa/api/resources/company.rb on lines 14..21

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

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

        def parent
          if project_id
            Kentaa::Api::Resources::Project.new(config, id: project_id, options: options)
          elsif segment_id
            Kentaa::Api::Resources::Segment.new(config, id: segment_id, options: options)
Severity: Minor
Found in lib/kentaa/api/resources/company.rb and 1 other location - About 45 mins to fix
lib/kentaa/api/resources/team.rb on lines 14..21

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

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

  module Api
    module Resources
      class Location
        attr_reader :data

Severity: Minor
Found in lib/kentaa/api/resources/location.rb and 1 other location - About 35 mins to fix
lib/kentaa/api/resources/reward.rb on lines 4..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 2 locations. Consider refactoring.
Open

  module Api
    module Resources
      class Reward
        attr_reader :data

Severity: Minor
Found in lib/kentaa/api/resources/reward.rb and 1 other location - About 35 mins to fix
lib/kentaa/api/resources/location.rb on lines 4..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 4 locations. Consider refactoring.
Open

        def members
          @members ||= begin
            members = []

            if data[:members]
Severity: Minor
Found in lib/kentaa/api/resources/team.rb and 3 other locations - About 30 mins to fix
lib/kentaa/api/resources/company.rb on lines 48..60
lib/kentaa/api/resources/payment.rb on lines 65..77
lib/kentaa/api/resources/payment.rb on lines 79..91

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

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

        def orders
          @orders ||= begin
            orders = []

            if data[:orders]
Severity: Minor
Found in lib/kentaa/api/resources/payment.rb and 3 other locations - About 30 mins to fix
lib/kentaa/api/resources/company.rb on lines 48..60
lib/kentaa/api/resources/payment.rb on lines 65..77
lib/kentaa/api/resources/team.rb on lines 48..60

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

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

        def members
          @members ||= begin
            members = []

            if data[:members]
Severity: Minor
Found in lib/kentaa/api/resources/company.rb and 3 other locations - About 30 mins to fix
lib/kentaa/api/resources/payment.rb on lines 65..77
lib/kentaa/api/resources/payment.rb on lines 79..91
lib/kentaa/api/resources/team.rb on lines 48..60

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

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

        def donations
          @donations ||= begin
            donations = []

            if data[:donations]
Severity: Minor
Found in lib/kentaa/api/resources/payment.rb and 3 other locations - About 30 mins to fix
lib/kentaa/api/resources/company.rb on lines 48..60
lib/kentaa/api/resources/payment.rb on lines 79..91
lib/kentaa/api/resources/team.rb on lines 48..60

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

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

        def questions
          @questions ||= begin
            questions = []

            if data[:questions]
Severity: Major
Found in lib/kentaa/api/resources/donation.rb and 24 other locations - About 20 mins to fix
lib/kentaa/api/resources/action.rb on lines 171..183
lib/kentaa/api/resources/action.rb on lines 185..197
lib/kentaa/api/resources/action.rb on lines 199..211
lib/kentaa/api/resources/action.rb on lines 219..231
lib/kentaa/api/resources/company.rb on lines 122..134
lib/kentaa/api/resources/company.rb on lines 136..148
lib/kentaa/api/resources/company.rb on lines 150..162
lib/kentaa/api/resources/company.rb on lines 184..196
lib/kentaa/api/resources/donation.rb on lines 258..270
lib/kentaa/api/resources/donation_form.rb on lines 66..78
lib/kentaa/api/resources/newsletter_subscription.rb on lines 77..89
lib/kentaa/api/resources/order.rb on lines 74..86
lib/kentaa/api/resources/project.rb on lines 94..106
lib/kentaa/api/resources/project.rb on lines 108..120
lib/kentaa/api/resources/project.rb on lines 122..134
lib/kentaa/api/resources/project.rb on lines 142..154
lib/kentaa/api/resources/segment.rb on lines 66..78
lib/kentaa/api/resources/site.rb on lines 70..82
lib/kentaa/api/resources/site.rb on lines 84..96
lib/kentaa/api/resources/team.rb on lines 118..130
lib/kentaa/api/resources/team.rb on lines 132..144
lib/kentaa/api/resources/team.rb on lines 146..158
lib/kentaa/api/resources/user.rb on lines 99..111
lib/kentaa/api/response.rb on lines 35..47

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

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

        def videos
          @videos ||= begin
            videos = []

            if data[:videos]
Severity: Major
Found in lib/kentaa/api/resources/company.rb and 24 other locations - About 20 mins to fix
lib/kentaa/api/resources/action.rb on lines 171..183
lib/kentaa/api/resources/action.rb on lines 185..197
lib/kentaa/api/resources/action.rb on lines 199..211
lib/kentaa/api/resources/action.rb on lines 219..231
lib/kentaa/api/resources/company.rb on lines 122..134
lib/kentaa/api/resources/company.rb on lines 150..162
lib/kentaa/api/resources/company.rb on lines 184..196
lib/kentaa/api/resources/donation.rb on lines 218..230
lib/kentaa/api/resources/donation.rb on lines 258..270
lib/kentaa/api/resources/donation_form.rb on lines 66..78
lib/kentaa/api/resources/newsletter_subscription.rb on lines 77..89
lib/kentaa/api/resources/order.rb on lines 74..86
lib/kentaa/api/resources/project.rb on lines 94..106
lib/kentaa/api/resources/project.rb on lines 108..120
lib/kentaa/api/resources/project.rb on lines 122..134
lib/kentaa/api/resources/project.rb on lines 142..154
lib/kentaa/api/resources/segment.rb on lines 66..78
lib/kentaa/api/resources/site.rb on lines 70..82
lib/kentaa/api/resources/site.rb on lines 84..96
lib/kentaa/api/resources/team.rb on lines 118..130
lib/kentaa/api/resources/team.rb on lines 132..144
lib/kentaa/api/resources/team.rb on lines 146..158
lib/kentaa/api/resources/user.rb on lines 99..111
lib/kentaa/api/response.rb on lines 35..47

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

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

        def consents
          @consents ||= begin
            consents = []

            if data[:consents]
Severity: Major
Found in lib/kentaa/api/resources/action.rb and 24 other locations - About 20 mins to fix
lib/kentaa/api/resources/action.rb on lines 171..183
lib/kentaa/api/resources/action.rb on lines 185..197
lib/kentaa/api/resources/action.rb on lines 199..211
lib/kentaa/api/resources/company.rb on lines 122..134
lib/kentaa/api/resources/company.rb on lines 136..148
lib/kentaa/api/resources/company.rb on lines 150..162
lib/kentaa/api/resources/company.rb on lines 184..196
lib/kentaa/api/resources/donation.rb on lines 218..230
lib/kentaa/api/resources/donation.rb on lines 258..270
lib/kentaa/api/resources/donation_form.rb on lines 66..78
lib/kentaa/api/resources/newsletter_subscription.rb on lines 77..89
lib/kentaa/api/resources/order.rb on lines 74..86
lib/kentaa/api/resources/project.rb on lines 94..106
lib/kentaa/api/resources/project.rb on lines 108..120
lib/kentaa/api/resources/project.rb on lines 122..134
lib/kentaa/api/resources/project.rb on lines 142..154
lib/kentaa/api/resources/segment.rb on lines 66..78
lib/kentaa/api/resources/site.rb on lines 70..82
lib/kentaa/api/resources/site.rb on lines 84..96
lib/kentaa/api/resources/team.rb on lines 118..130
lib/kentaa/api/resources/team.rb on lines 132..144
lib/kentaa/api/resources/team.rb on lines 146..158
lib/kentaa/api/resources/user.rb on lines 99..111
lib/kentaa/api/response.rb on lines 35..47

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

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

        def photos
          @photos ||= begin
            photos = []

            if data[:photos]
Severity: Major
Found in lib/kentaa/api/resources/project.rb and 24 other locations - About 20 mins to fix
lib/kentaa/api/resources/action.rb on lines 171..183
lib/kentaa/api/resources/action.rb on lines 185..197
lib/kentaa/api/resources/action.rb on lines 199..211
lib/kentaa/api/resources/action.rb on lines 219..231
lib/kentaa/api/resources/company.rb on lines 122..134
lib/kentaa/api/resources/company.rb on lines 136..148
lib/kentaa/api/resources/company.rb on lines 150..162
lib/kentaa/api/resources/company.rb on lines 184..196
lib/kentaa/api/resources/donation.rb on lines 218..230
lib/kentaa/api/resources/donation.rb on lines 258..270
lib/kentaa/api/resources/donation_form.rb on lines 66..78
lib/kentaa/api/resources/newsletter_subscription.rb on lines 77..89
lib/kentaa/api/resources/order.rb on lines 74..86
lib/kentaa/api/resources/project.rb on lines 108..120
lib/kentaa/api/resources/project.rb on lines 122..134
lib/kentaa/api/resources/project.rb on lines 142..154
lib/kentaa/api/resources/segment.rb on lines 66..78
lib/kentaa/api/resources/site.rb on lines 70..82
lib/kentaa/api/resources/site.rb on lines 84..96
lib/kentaa/api/resources/team.rb on lines 118..130
lib/kentaa/api/resources/team.rb on lines 132..144
lib/kentaa/api/resources/team.rb on lines 146..158
lib/kentaa/api/resources/user.rb on lines 99..111
lib/kentaa/api/response.rb on lines 35..47

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

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

        def consents
          @consents ||= begin
            consents = []

            if data[:consents]
Severity: Major
Found in lib/kentaa/api/resources/donation.rb and 24 other locations - About 20 mins to fix
lib/kentaa/api/resources/action.rb on lines 171..183
lib/kentaa/api/resources/action.rb on lines 185..197
lib/kentaa/api/resources/action.rb on lines 199..211
lib/kentaa/api/resources/action.rb on lines 219..231
lib/kentaa/api/resources/company.rb on lines 122..134
lib/kentaa/api/resources/company.rb on lines 136..148
lib/kentaa/api/resources/company.rb on lines 150..162
lib/kentaa/api/resources/company.rb on lines 184..196
lib/kentaa/api/resources/donation.rb on lines 218..230
lib/kentaa/api/resources/donation_form.rb on lines 66..78
lib/kentaa/api/resources/newsletter_subscription.rb on lines 77..89
lib/kentaa/api/resources/order.rb on lines 74..86
lib/kentaa/api/resources/project.rb on lines 94..106
lib/kentaa/api/resources/project.rb on lines 108..120
lib/kentaa/api/resources/project.rb on lines 122..134
lib/kentaa/api/resources/project.rb on lines 142..154
lib/kentaa/api/resources/segment.rb on lines 66..78
lib/kentaa/api/resources/site.rb on lines 70..82
lib/kentaa/api/resources/site.rb on lines 84..96
lib/kentaa/api/resources/team.rb on lines 118..130
lib/kentaa/api/resources/team.rb on lines 132..144
lib/kentaa/api/resources/team.rb on lines 146..158
lib/kentaa/api/resources/user.rb on lines 99..111
lib/kentaa/api/response.rb on lines 35..47

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

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

      def errors
        @errors ||= begin
          errors = []

          if body[:errors]
Severity: Major
Found in lib/kentaa/api/response.rb and 24 other locations - About 20 mins to fix
lib/kentaa/api/resources/action.rb on lines 171..183
lib/kentaa/api/resources/action.rb on lines 185..197
lib/kentaa/api/resources/action.rb on lines 199..211
lib/kentaa/api/resources/action.rb on lines 219..231
lib/kentaa/api/resources/company.rb on lines 122..134
lib/kentaa/api/resources/company.rb on lines 136..148
lib/kentaa/api/resources/company.rb on lines 150..162
lib/kentaa/api/resources/company.rb on lines 184..196
lib/kentaa/api/resources/donation.rb on lines 218..230
lib/kentaa/api/resources/donation.rb on lines 258..270
lib/kentaa/api/resources/donation_form.rb on lines 66..78
lib/kentaa/api/resources/newsletter_subscription.rb on lines 77..89
lib/kentaa/api/resources/order.rb on lines 74..86
lib/kentaa/api/resources/project.rb on lines 94..106
lib/kentaa/api/resources/project.rb on lines 108..120
lib/kentaa/api/resources/project.rb on lines 122..134
lib/kentaa/api/resources/project.rb on lines 142..154
lib/kentaa/api/resources/segment.rb on lines 66..78
lib/kentaa/api/resources/site.rb on lines 70..82
lib/kentaa/api/resources/site.rb on lines 84..96
lib/kentaa/api/resources/team.rb on lines 118..130
lib/kentaa/api/resources/team.rb on lines 132..144
lib/kentaa/api/resources/team.rb on lines 146..158
lib/kentaa/api/resources/user.rb on lines 99..111

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

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

        def questions
          @questions ||= begin
            questions = []

            if data[:questions]
Severity: Major
Found in lib/kentaa/api/resources/team.rb and 24 other locations - About 20 mins to fix
lib/kentaa/api/resources/action.rb on lines 171..183
lib/kentaa/api/resources/action.rb on lines 185..197
lib/kentaa/api/resources/action.rb on lines 199..211
lib/kentaa/api/resources/action.rb on lines 219..231
lib/kentaa/api/resources/company.rb on lines 122..134
lib/kentaa/api/resources/company.rb on lines 136..148
lib/kentaa/api/resources/company.rb on lines 150..162
lib/kentaa/api/resources/company.rb on lines 184..196
lib/kentaa/api/resources/donation.rb on lines 218..230
lib/kentaa/api/resources/donation.rb on lines 258..270
lib/kentaa/api/resources/donation_form.rb on lines 66..78
lib/kentaa/api/resources/newsletter_subscription.rb on lines 77..89
lib/kentaa/api/resources/order.rb on lines 74..86
lib/kentaa/api/resources/project.rb on lines 94..106
lib/kentaa/api/resources/project.rb on lines 108..120
lib/kentaa/api/resources/project.rb on lines 122..134
lib/kentaa/api/resources/project.rb on lines 142..154
lib/kentaa/api/resources/segment.rb on lines 66..78
lib/kentaa/api/resources/site.rb on lines 70..82
lib/kentaa/api/resources/site.rb on lines 84..96
lib/kentaa/api/resources/team.rb on lines 118..130
lib/kentaa/api/resources/team.rb on lines 132..144
lib/kentaa/api/resources/user.rb on lines 99..111
lib/kentaa/api/response.rb on lines 35..47

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

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

        def consents
          @consents ||= begin
            consents = []

            if data[:consents]
Severity: Major
Found in lib/kentaa/api/resources/newsletter_subscription.rb and 24 other locations - About 20 mins to fix
lib/kentaa/api/resources/action.rb on lines 171..183
lib/kentaa/api/resources/action.rb on lines 185..197
lib/kentaa/api/resources/action.rb on lines 199..211
lib/kentaa/api/resources/action.rb on lines 219..231
lib/kentaa/api/resources/company.rb on lines 122..134
lib/kentaa/api/resources/company.rb on lines 136..148
lib/kentaa/api/resources/company.rb on lines 150..162
lib/kentaa/api/resources/company.rb on lines 184..196
lib/kentaa/api/resources/donation.rb on lines 218..230
lib/kentaa/api/resources/donation.rb on lines 258..270
lib/kentaa/api/resources/donation_form.rb on lines 66..78
lib/kentaa/api/resources/order.rb on lines 74..86
lib/kentaa/api/resources/project.rb on lines 94..106
lib/kentaa/api/resources/project.rb on lines 108..120
lib/kentaa/api/resources/project.rb on lines 122..134
lib/kentaa/api/resources/project.rb on lines 142..154
lib/kentaa/api/resources/segment.rb on lines 66..78
lib/kentaa/api/resources/site.rb on lines 70..82
lib/kentaa/api/resources/site.rb on lines 84..96
lib/kentaa/api/resources/team.rb on lines 118..130
lib/kentaa/api/resources/team.rb on lines 132..144
lib/kentaa/api/resources/team.rb on lines 146..158
lib/kentaa/api/resources/user.rb on lines 99..111
lib/kentaa/api/response.rb on lines 35..47

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

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