Showing 349 of 349 total issues

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

@doc(
    tags=['financial'],
    description=docs.TOTALS,
    params={
        'committee_type': {
Severity: Major
Found in webservices/resources/totals.py and 1 other location - About 3 days to fix
webservices/resources/totals.py on lines 88..142

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

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

@doc(
    tags=['financial'],
    description=docs.TOTALS,
    params={
        'committee_id': {'description': docs.COMMITTEE_ID},
Severity: Major
Found in webservices/resources/totals.py and 1 other location - About 3 days to fix
webservices/resources/totals.py on lines 32..85

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

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

File docs.py has 1091 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Narrative API documentation."""

BEGINNING_IMAGE_NUMBER = '''
Unique identifier for the electronic or paper report. This number is used to construct
PDF URLs to the original document.
Severity: Major
Found in webservices/docs.py - About 2 days to fix

    File schemas.py has 944 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import re
    import functools
    import json
    
    from collections import namedtuple
    Severity: Major
    Found in webservices/schemas.py - About 2 days to fix

      File marked.js has 901 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * marked - a markdown parser
       * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
       * https://github.com/chjj/marked
       */
      Severity: Major
      Found in static/swagger-ui/vendor/marked.js - About 2 days to fix

        Function render has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
        Open

          render: function() {
            var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, l, len, len1, len2, len3, len4, m, modelAuths, n, o, p, param, q, ref, ref1, ref2, ref3, ref4, ref5, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successResponse, type, v, value;
            isMethodSubmissionSupported = jQuery.inArray(this.model.method, this.model.supportedSubmitMethods()) >= 0;
            if (!isMethodSubmissionSupported) {
              this.model.isReadOnly = true;
        Severity: Minor
        Found in swagger-ui/js/view/OperationView.js - About 2 days 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

        File args.py has 658 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import functools
        
        from marshmallow.compat import text_type
        
        import sqlalchemy as sa
        Severity: Major
        Found in webservices/args.py - About 1 day to fix

          File OperationView.js has 648 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          SwaggerUi.Views.OperationView = Backbone.View.extend({
            invocationUrl: null,
          
          
          Severity: Major
          Found in swagger-ui/js/view/OperationView.js - About 1 day to fix

            File itemized.py has 647 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import marshmallow as ma
            import sqlalchemy as sa
            
            from sqlalchemy.ext.hybrid import hybrid_property
            from sqlalchemy.dialects.postgresql import TSVECTOR
            Severity: Major
            Found in webservices/common/models/itemized.py - About 1 day to fix

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

                          if not row['fileimage']:
                              logger.error('Error uploading document ID {0} for MUR Case {1}: No file image'.format(row['document_id'], row['case_no']))
                          else:
                              pdf_key = 'legal/murs/{0}/{1}'.format(row['case_no'],
                                  row['filename'].replace(' ', '-'))
              Severity: Major
              Found in webservices/legal_docs/current_murs.py and 1 other location - About 1 day to fix
              webservices/legal_docs/advisory_opinions.py on lines 186..195

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

              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 not row['fileimage']:
                              logger.error('Error uploading document ID {0} for AO no {1}: No file image'.format(row['document_id'], row['ao_no']))
                          else:
                              pdf_key = "legal/aos/{0}/{1}".format(row['ao_no'],
                                  row["filename"].replace(' ', '-'))
              Severity: Major
              Found in webservices/legal_docs/advisory_opinions.py and 1 other location - About 1 day to fix
              webservices/legal_docs/current_murs.py on lines 316..325

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

              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

              @doc(
                  tags=['receipts'],
                  description=(
                      'Schedule A receipts aggregated by contributor employer name. To avoid double '
                      'counting, memoed items are not included.'
              Severity: Major
              Found in webservices/resources/aggregates.py and 1 other location - About 1 day to fix
              webservices/resources/aggregates.py on lines 132..155

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

              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

              @doc(
                  tags=['receipts'],
                  description=(
                      'Schedule A receipts aggregated by contributor occupation. To avoid double '
                      'counting, memoed items are not included.'
              Severity: Major
              Found in webservices/resources/aggregates.py and 1 other location - About 1 day to fix
              webservices/resources/aggregates.py on lines 106..129

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

              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

              Function token has 213 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Lexer.prototype.token = function(src, top, bq) {
                var src = src.replace(/^ +$/gm, '')
                  , next
                  , loose
                  , cap
              Severity: Major
              Found in static/swagger-ui/vendor/marked.js - About 1 day to fix

                File reports.py has 506 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                from webservices import docs, utils
                
                from .base import db, BaseModel
                
                from sqlalchemy.ext.hybrid import hybrid_property
                Severity: Major
                Found in webservices/common/models/reports.py - About 1 day to fix

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

                  @doc(
                      tags=['efiling'],
                      description=docs.EFILE_REPORTS,
                  )
                  class EFilingHouseSenateSummaryView(views.ApiResource):
                  Severity: Major
                  Found in webservices/resources/reports.py and 2 other locations - About 1 day to fix
                  webservices/resources/reports.py on lines 247..278
                  webservices/resources/reports.py on lines 281..312

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

                  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

                  @doc(
                      tags=['efiling'],
                      description=docs.EFILE_REPORTS,
                  )
                  class EFilingPresidentialSummaryView(views.ApiResource):
                  Severity: Major
                  Found in webservices/resources/reports.py and 2 other locations - About 1 day to fix
                  webservices/resources/reports.py on lines 213..244
                  webservices/resources/reports.py on lines 281..312

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

                  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

                  @doc(
                      tags=['efiling'],
                      description=docs.EFILE_REPORTS,
                  )
                  class EFilingPacPartySummaryView(views.ApiResource):
                  Severity: Major
                  Found in webservices/resources/reports.py and 2 other locations - About 1 day to fix
                  webservices/resources/reports.py on lines 213..244
                  webservices/resources/reports.py on lines 247..278

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

                  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

                  @doc(
                      tags=['loans'],
                      description=docs.SCHEDULE_C,
                  )
                  class ScheduleCViewBySubId(ApiResource):
                  Severity: Major
                  Found in webservices/resources/sched_c.py and 2 other locations - About 7 hrs to fix
                  webservices/resources/sched_d.py on lines 64..85
                  webservices/resources/sched_f.py on lines 60..81

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

                  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

                  @doc(
                      tags=['party-coordinated expenditures'],
                      description=docs.SCHEDULE_F,
                  )
                  class ScheduleFViewBySubId(ApiResource):
                  Severity: Major
                  Found in webservices/resources/sched_f.py and 2 other locations - About 7 hrs to fix
                  webservices/resources/sched_c.py on lines 62..84
                  webservices/resources/sched_d.py on lines 64..85

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

                  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