oneclickorgs/one-click-orgs

View on GitHub

Showing 108 of 108 total issues

Method dashboard has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def dashboard

    @new_proposal = co.proposals.new

    case co
Severity: Minor
Found in app/controllers/one_click_controller.rb - About 1 hr to fix

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

        if organisation.max_producer_directors != max_producer_directors.to_i
          proposal = if ability.can?(:create, Resolution)
            organisation.change_integer_resolutions.build(
              :name => 'max_producer_directors',
              :value => max_producer_directors.to_i,
    Severity: Major
    Found in app/models/constitution_proposal_bundle.rb and 4 other locations - About 1 hr to fix
    app/models/constitution_proposal_bundle.rb on lines 488..510
    app/models/constitution_proposal_bundle.rb on lines 514..536
    app/models/constitution_proposal_bundle.rb on lines 540..562
    app/models/constitution_proposal_bundle.rb on lines 592..614

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        if organisation.max_user_directors != max_user_directors.to_i
          proposal = if ability.can?(:create, Resolution)
            organisation.change_integer_resolutions.build(
              :name => 'max_user_directors',
              :value => max_user_directors.to_i,
    Severity: Major
    Found in app/models/constitution_proposal_bundle.rb and 4 other locations - About 1 hr to fix
    app/models/constitution_proposal_bundle.rb on lines 514..536
    app/models/constitution_proposal_bundle.rb on lines 540..562
    app/models/constitution_proposal_bundle.rb on lines 566..588
    app/models/constitution_proposal_bundle.rb on lines 592..614

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        if organisation.max_consumer_directors != max_consumer_directors.to_i
          proposal = if ability.can?(:create, Resolution)
            organisation.change_integer_resolutions.build(
              :name => 'max_consumer_directors',
              :value => max_consumer_directors.to_i,
    Severity: Major
    Found in app/models/constitution_proposal_bundle.rb and 4 other locations - About 1 hr to fix
    app/models/constitution_proposal_bundle.rb on lines 488..510
    app/models/constitution_proposal_bundle.rb on lines 514..536
    app/models/constitution_proposal_bundle.rb on lines 540..562
    app/models/constitution_proposal_bundle.rb on lines 566..588

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        if organisation.max_employee_directors != max_employee_directors.to_i
          proposal = if ability.can?(:create, Resolution)
            organisation.change_integer_resolutions.build(
              :name => 'max_employee_directors',
              :value => max_employee_directors.to_i,
    Severity: Major
    Found in app/models/constitution_proposal_bundle.rb and 4 other locations - About 1 hr to fix
    app/models/constitution_proposal_bundle.rb on lines 488..510
    app/models/constitution_proposal_bundle.rb on lines 540..562
    app/models/constitution_proposal_bundle.rb on lines 566..588
    app/models/constitution_proposal_bundle.rb on lines 592..614

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        if organisation.max_supporter_directors != max_supporter_directors.to_i
          proposal = if ability.can?(:create, Resolution)
            organisation.change_integer_resolutions.build(
              :name => 'max_supporter_directors',
              :value => max_supporter_directors.to_i,
    Severity: Major
    Found in app/models/constitution_proposal_bundle.rb and 4 other locations - About 1 hr to fix
    app/models/constitution_proposal_bundle.rb on lines 488..510
    app/models/constitution_proposal_bundle.rb on lines 514..536
    app/models/constitution_proposal_bundle.rb on lines 566..588
    app/models/constitution_proposal_bundle.rb on lines 592..614

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

    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

    Method document has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def document
        # TODO Make this work for Organisation subclasses other than Coop.
        if document_template
          document = document_template
        elsif document_id = Setting[:coop_constitution_document_id]
    Severity: Minor
    Found in app/models/constitution.rb - About 1 hr to fix

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

          if (organisation.producer_members && !new_producer_members_value) || (!organisation.producer_members && new_producer_members_value) # Bit verbose, to cope with null values
            proposal = if ability.can?(:create, Resolution)
              organisation.change_boolean_resolutions.build(
                :title => title,
                :name => 'producer_members',
      Severity: Major
      Found in app/models/constitution_proposal_bundle.rb and 6 other locations - About 1 hr to fix
      app/models/constitution_proposal_bundle.rb on lines 294..318
      app/models/constitution_proposal_bundle.rb on lines 327..351
      app/models/constitution_proposal_bundle.rb on lines 360..384
      app/models/constitution_proposal_bundle.rb on lines 426..450
      app/models/constitution_proposal_bundle.rb on lines 460..484
      app/models/constitution_proposal_bundle.rb on lines 626..650

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

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

          if (organisation.employee_members && !new_employee_members_value) || (!organisation.employee_members && new_employee_members_value) # Bit verbose, to cope with null values
            proposal = if ability.can?(:create, Resolution)
              organisation.change_boolean_resolutions.build(
                :title => title,
                :name => 'employee_members',
      Severity: Major
      Found in app/models/constitution_proposal_bundle.rb and 6 other locations - About 1 hr to fix
      app/models/constitution_proposal_bundle.rb on lines 294..318
      app/models/constitution_proposal_bundle.rb on lines 360..384
      app/models/constitution_proposal_bundle.rb on lines 393..417
      app/models/constitution_proposal_bundle.rb on lines 426..450
      app/models/constitution_proposal_bundle.rb on lines 460..484
      app/models/constitution_proposal_bundle.rb on lines 626..650

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

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

          if (organisation.supporter_members && !new_supporter_members_value) || (!organisation.supporter_members && new_supporter_members_value) # Bit verbose, to cope with null values
            proposal = if ability.can?(:create, Resolution)
              organisation.change_boolean_resolutions.build(
                :title => title,
                :name => 'supporter_members',
      Severity: Major
      Found in app/models/constitution_proposal_bundle.rb and 6 other locations - About 1 hr to fix
      app/models/constitution_proposal_bundle.rb on lines 294..318
      app/models/constitution_proposal_bundle.rb on lines 327..351
      app/models/constitution_proposal_bundle.rb on lines 393..417
      app/models/constitution_proposal_bundle.rb on lines 426..450
      app/models/constitution_proposal_bundle.rb on lines 460..484
      app/models/constitution_proposal_bundle.rb on lines 626..650

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

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

          if (organisation.consumer_members && !new_consumer_members_value) || (!organisation.consumer_members && new_consumer_members_value) # Bit verbose, to cope with null values
            proposal = if ability.can?(:create, Resolution)
              organisation.change_boolean_resolutions.build(
                :title => title,
                :name => 'consumer_members',
      Severity: Major
      Found in app/models/constitution_proposal_bundle.rb and 6 other locations - About 1 hr to fix
      app/models/constitution_proposal_bundle.rb on lines 294..318
      app/models/constitution_proposal_bundle.rb on lines 327..351
      app/models/constitution_proposal_bundle.rb on lines 360..384
      app/models/constitution_proposal_bundle.rb on lines 393..417
      app/models/constitution_proposal_bundle.rb on lines 460..484
      app/models/constitution_proposal_bundle.rb on lines 626..650

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

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

          if (organisation.user_members && !new_user_members_value) || (!organisation.user_members && new_user_members_value) # Bit verbose, to cope with null values
            proposal = if ability.can?(:create, Resolution)
              organisation.change_boolean_resolutions.build(
                :title => title,
                :name => 'user_members',
      Severity: Major
      Found in app/models/constitution_proposal_bundle.rb and 6 other locations - About 1 hr to fix
      app/models/constitution_proposal_bundle.rb on lines 327..351
      app/models/constitution_proposal_bundle.rb on lines 360..384
      app/models/constitution_proposal_bundle.rb on lines 393..417
      app/models/constitution_proposal_bundle.rb on lines 426..450
      app/models/constitution_proposal_bundle.rb on lines 460..484
      app/models/constitution_proposal_bundle.rb on lines 626..650

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

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

          if (organisation.common_ownership && !new_common_ownership_value) || (!organisation.common_ownership && new_common_ownership_value) # Bit verbose, to cope with null values
            proposal = if ability.can?(:create, Resolution)
              organisation.change_boolean_resolutions.build(
                :title => title,
                :name => 'common_ownership',
      Severity: Major
      Found in app/models/constitution_proposal_bundle.rb and 6 other locations - About 1 hr to fix
      app/models/constitution_proposal_bundle.rb on lines 294..318
      app/models/constitution_proposal_bundle.rb on lines 327..351
      app/models/constitution_proposal_bundle.rb on lines 360..384
      app/models/constitution_proposal_bundle.rb on lines 393..417
      app/models/constitution_proposal_bundle.rb on lines 426..450
      app/models/constitution_proposal_bundle.rb on lines 460..484

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

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

          if (organisation.single_shareholding && !new_single_shareholding_value) || (!organisation.single_shareholding && new_single_shareholding_value) # Bit verbose, to cope with null values
            proposal = if ability.can?(:create, Resolution)
              organisation.change_boolean_resolutions.build(
                :title => title,
                :name => 'single_shareholding',
      Severity: Major
      Found in app/models/constitution_proposal_bundle.rb and 6 other locations - About 1 hr to fix
      app/models/constitution_proposal_bundle.rb on lines 294..318
      app/models/constitution_proposal_bundle.rb on lines 327..351
      app/models/constitution_proposal_bundle.rb on lines 360..384
      app/models/constitution_proposal_bundle.rb on lines 393..417
      app/models/constitution_proposal_bundle.rb on lines 426..450
      app/models/constitution_proposal_bundle.rb on lines 626..650

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

      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

      Method create has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def create
          @association = Association.new(params[:association])
          @founder = Member.new(params[:founder])
          
          errors = []
      Severity: Minor
      Found in app/controllers/associations_controller.rb - About 1 hr to fix

        Method set_member_class has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def set_member_class
            return unless director && (elected_on || ended_on)
            if ended_on
              member_member_class = organisation.member_classes.find_by_name('Member')
              director.member_class = member_member_class if member_member_class
        Severity: Minor
        Found in app/models/directorship.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method dashboard has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def dashboard
        
            @new_proposal = co.proposals.new
        
            case co
        Severity: Minor
        Found in app/controllers/one_click_controller.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

          def create
            @association = Association.new(params[:association])
            @founder = Member.new(params[:founder])
            
            errors = []
        Severity: Minor
        Found in app/controllers/associations_controller.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            if organisation.name != organisation_name
              proposal = if ability.can?(:create, Resolution)
                organisation.change_text_resolutions.build(
                  :name => 'organisation_name',
                  :value => organisation_name,
        Severity: Major
        Found in app/models/constitution_proposal_bundle.rb and 1 other location - About 1 hr to fix
        app/models/constitution_proposal_bundle.rb on lines 261..281

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

        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

            if organisation.registered_office_address != registered_office_address
              proposal = if ability.can?(:create, Resolution)
                organisation.change_text_resolutions.build(
                  :name => 'registered_office_address',
                  :value => registered_office_address,
        Severity: Major
        Found in app/models/constitution_proposal_bundle.rb and 1 other location - About 1 hr to fix
        app/models/constitution_proposal_bundle.rb on lines 209..229

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

        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