SumOfUs/Champaign

View on GitHub

Showing 338 of 338 total issues

Method express_payment has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def express_payment
    @page = Page.find(params[:page_id])
    @follow_up_url = ''

    begin
Severity: Minor
Found in app/controllers/api/payment/braintree_controller.rb - About 1 hr to fix

    Method subscription_payload has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def subscription_payload
          {
            type: 'donation',
            payment_provider: 'braintree',
            params: {
    Severity: Minor
    Found in app/services/action_queue.rb - About 1 hr to fix

      Method total_donations has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def total_donations
          @page = Page.find(params[:page_id])
      
          if @page.campaign.blank?
            amount = @page.total_donations
      Severity: Minor
      Found in app/controllers/api/pages_controller.rb - About 1 hr to fix

        Function PetitionComponent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function PetitionComponent(props: IProps) {
          const dispatch = useDispatch();
          const member: IChampaignMember = useSelector((state: any) => state.member);
          const fields = filterNonEmptyFields(props.config.fields, member);
        
        
        Severity: Minor
        Found in app/javascript/plugins/petition/PetitionComponent.tsx - About 1 hr to fix

          Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def initialize(nonce, amount, currency, user, page_id, store_in_vault, device_data, extra_params)
          Severity: Major
          Found in app/lib/payment_processor/braintree/subscription.rb - About 1 hr to fix

            Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def initialize(nonce, amount, currency, user, page_id,
                                 store_in_vault = false, device_data = {}, extra_params = {})
            Severity: Major
            Found in app/lib/payment_processor/braintree/transaction.rb - About 1 hr to fix

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

                          <button
                            className={lastWeekButtonClasses}
                            type="button"
                            onClick={() => {
                              this.updateFilter('last_week');
              app/javascript/plugins/call_tool_analytics/CallToolAnalyticsView.js on lines 70..79

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

                    const localPaymentTypes = getLocalPaymentTypes({
                      country: state.form.country || state.formValues.country,
                      recurring: action.payload,
                      currency: state.currency,
                    });
              Severity: Major
              Found in app/javascript/state/fundraiser/reducer.js and 2 other locations - About 1 hr to fix
              app/javascript/state/fundraiser/reducer.js on lines 165..169
              app/javascript/state/fundraiser/reducer.js on lines 248..252

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

                    const localPaymentTypes = getLocalPaymentTypes({
                      country: state.form.country || state.formValues.country,
                      recurring: action.payload,
                      currency: state.currency,
                    });
              Severity: Major
              Found in app/javascript/state/fundraiser/reducer.js and 2 other locations - About 1 hr to fix
              app/javascript/state/fundraiser/reducer.js on lines 216..220
              app/javascript/state/fundraiser/reducer.js on lines 248..252

              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

                          <button
                            className={allTimeButtonClasses}
                            type="button"
                            onClick={() => {
                              this.updateFilter('all_time');
              app/javascript/plugins/call_tool_analytics/CallToolAnalyticsView.js on lines 60..69

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

                    const localPaymentTypes = getLocalPaymentTypes({
                      country: state.form.country || state.formValues.country,
                      recurring: data.recurring,
                      currency: state.currency,
                    });
              Severity: Major
              Found in app/javascript/state/fundraiser/reducer.js and 2 other locations - About 1 hr to fix
              app/javascript/state/fundraiser/reducer.js on lines 165..169
              app/javascript/state/fundraiser/reducer.js on lines 216..220

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

                const onChange = (e: SyntheticEvent<HTMLTextAreaElement>) => {
                  if (props.onChange) {
                    props.onChange(e.currentTarget.value);
                  }
                };
              Severity: Major
              Found in app/javascript/components/Form/FieldTypes/index.tsx and 2 other locations - About 1 hr to fix
              app/javascript/components/Form/FieldTypes/index.tsx on lines 59..63
              app/javascript/components/Form/FieldTypes/index.tsx on lines 148..152

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

                const onChange = (event: SyntheticEvent<HTMLInputElement>) => {
                  if (props.onChange) {
                    props.onChange(event.currentTarget.value);
                  }
                };
              Severity: Major
              Found in app/javascript/components/Form/FieldTypes/index.tsx and 2 other locations - About 1 hr to fix
              app/javascript/components/Form/FieldTypes/index.tsx on lines 127..131
              app/javascript/components/Form/FieldTypes/index.tsx on lines 148..152

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

                const onChange = (e: SyntheticEvent<HTMLInputElement>) => {
                  if (props.onChange) {
                    props.onChange(e.currentTarget.checked);
                  }
                };
              Severity: Major
              Found in app/javascript/components/Form/FieldTypes/index.tsx and 2 other locations - About 1 hr to fix
              app/javascript/components/Form/FieldTypes/index.tsx on lines 59..63
              app/javascript/components/Form/FieldTypes/index.tsx on lines 127..131

              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

                  <Button
                    className="DonateButton"
                    name={props.name}
                    onClick={props.onClick}
                    disabled={props.disabled}
              Severity: Minor
              Found in app/javascript/components/DonateButton.js and 1 other location - About 55 mins to fix
              app/javascript/components/Checkbox/Checkbox.js on lines 10..16

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

              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

                      <a
                        onClick={this.toggleCurrencyDropd.bind(this)}
                        className="AmountSelection__currency-toggle"
                      >
                        <FormattedMessage
              Severity: Minor
              Found in app/javascript/components/CurrencySelector/CurrencySelector.js and 1 other location - About 55 mins to fix
              app/javascript/components/AmountSelection/AmountSelection.js on lines 84..92

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

              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

                      <input
                        type="checkbox"
                        disabled={props.disabled}
                        checked={props.checked}
                        defaultChecked={props.defaultChecked}
              Severity: Minor
              Found in app/javascript/components/Checkbox/Checkbox.js and 1 other location - About 55 mins to fix
              app/javascript/components/DonateButton.js on lines 27..54

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

              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

                        <a
                          onClick={this.toggleCurrencyDropd.bind(this)}
                          className="AmountSelection__currency-toggle"
                        >
                          <FormattedMessage
              Severity: Minor
              Found in app/javascript/components/AmountSelection/AmountSelection.js and 1 other location - About 55 mins to fix
              app/javascript/components/CurrencySelector/CurrencySelector.js on lines 54..62

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

              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

                createAction(pageId: number | string, payload: any): Promise<IApiResponse> {
                  return client.post(`/api/pages/${pageId}/actions`, payload);
                },
              Severity: Minor
              Found in app/javascript/modules/api/resources/pages.ts and 1 other location - About 55 mins to fix
              app/javascript/modules/api/resources/pages.ts on lines 4..6

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

              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

                validateForm(pageId: number | string, payload: any): Promise<IApiResponse> {
                  return client.post(`/api/pages/${pageId}/actions/validate`, payload);
                },
              Severity: Minor
              Found in app/javascript/modules/api/resources/pages.ts and 1 other location - About 55 mins to fix
              app/javascript/modules/api/resources/pages.ts on lines 8..10

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

              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