Showing 349 of 349 total issues

Function build_test has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def build_test(ctx, source, dest, fraction=DEFAULT_FRACTION, log=True):
Severity: Minor
Found in tasks.py - About 35 mins to fix

    Function make_multi_sort_args has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def make_multi_sort_args(default=None, validator=None, default_hide_null=False, default_reverse_nulls=True,
    Severity: Minor
    Found in webservices/args.py - About 35 mins to fix

      Function parse_option has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def parse_option(option, model=None, aliases=None, join_columns=None, query=None):
      Severity: Minor
      Found in webservices/sorting.py - About 35 mins to fix

        Function make_sort_args has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def make_sort_args(default=None, validator=None, default_hide_null=False, default_reverse_nulls=True,
        Severity: Minor
        Found in webservices/args.py - About 35 mins to fix

          Function fetch_subset has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def fetch_subset(ctx, source, dest, fraction=DEFAULT_FRACTION, log=True):
          Severity: Minor
          Found in tasks.py - About 35 mins to fix

            Function initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              initialize: function(options) {
                options = options || {};
                if(!options.highlightSizeThreshold) {
                  options.highlightSizeThreshold = 100000;
                }
            Severity: Minor
            Found in swagger-ui/js/SwaggerUi.js - About 35 mins 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

            Function extract_summary_rows has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def extract_summary_rows(self, obj):
                    if obj.get('summary_lines'):
                        for key, value in obj.get('summary_lines').items():
                            #may be a way to pull these out using pandas?
                            if key == 'nan':
            Severity: Minor
            Found in webservices/schemas.py - About 35 mins 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

            Function filter_match has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def filter_match(query, kwargs, fields):
                for key, column in fields:
                    if kwargs.get(key) is not None:
                        if is_exclude_arg(kwargs[key]):
                            query = query.filter(sa.or_(column != parse_exclude_arg(kwargs[key]),
            Severity: Minor
            Found in webservices/filters.py - About 35 mins 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

            Function document_description has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            def document_description(report_year, report_type=None, document_type=None, form_type=None):
                if report_type:
                    clean = re.sub(r'\{[^)]*\}', '', report_type)
                elif document_type:
                    clean = document_type
            Severity: Minor
            Found in webservices/utils.py - About 35 mins 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 7 locations. Consider refactoring.
            Open

                if kwargs.get('ao_requestor'):
                    must_clauses.append(Q('match', requestor_names=kwargs.get('ao_requestor')))
            Severity: Major
            Found in webservices/resources/legal.py and 6 other locations - About 35 mins to fix
            webservices/resources/legal.py on lines 156..157
            webservices/resources/legal.py on lines 158..159
            webservices/resources/legal.py on lines 160..161
            webservices/resources/legal.py on lines 162..163
            webservices/resources/legal.py on lines 214..215
            webservices/resources/legal.py on lines 223..224

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                if kwargs.get('ao_no'):
                    must_clauses.append(Q('terms', no=kwargs.get('ao_no')))
            Severity: Major
            Found in webservices/resources/legal.py and 6 other locations - About 35 mins to fix
            webservices/resources/legal.py on lines 156..157
            webservices/resources/legal.py on lines 158..159
            webservices/resources/legal.py on lines 160..161
            webservices/resources/legal.py on lines 162..163
            webservices/resources/legal.py on lines 223..224
            webservices/resources/legal.py on lines 226..227

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                        sa.func.to_tsvector(
                            sa.func.concat(parent.c.contbr_nm, ' ', parent.c.contbr_id),
            Severity: Minor
            Found in webservices/partition/sched_a.py and 1 other location - About 35 mins to fix
            webservices/partition/sched_b.py on lines 36..37

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                @use_kwargs(args.paging)
                @use_kwargs(args.make_sort_args())
                @use_kwargs(args.schedule_a_candidate_aggregate)
                @marshal_with(schemas.ScheduleAByStateCandidatePageSchema())
            Severity: Minor
            Found in webservices/resources/candidate_aggregates.py and 1 other location - About 35 mins to fix
            webservices/resources/candidate_aggregates.py on lines 83..86

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                    delete = sa.delete(queue).where(
                        queue.c.get(cls.primary).in_(record_ids)
            Severity: Minor
            Found in webservices/partition/base.py and 1 other location - About 35 mins to fix
            webservices/partition/base.py on lines 78..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 33.

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

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

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

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

            Refactorings

            Further Reading

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

                if kwargs.get('mur_no'):
                    must_clauses.append(Q('terms', no=kwargs.get('mur_no')))
            Severity: Major
            Found in webservices/resources/legal.py and 6 other locations - About 35 mins to fix
            webservices/resources/legal.py on lines 158..159
            webservices/resources/legal.py on lines 160..161
            webservices/resources/legal.py on lines 162..163
            webservices/resources/legal.py on lines 214..215
            webservices/resources/legal.py on lines 223..224
            webservices/resources/legal.py on lines 226..227

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                'designation': fields.List(
                    IStr(validate=validate.OneOf(['', 'A', 'J', 'P', 'U', 'B', 'D'])),
                    description=docs.DESIGNATION,
            Severity: Major
            Found in webservices/args.py and 3 other locations - About 35 mins to fix
            webservices/args.py on lines 232..234
            webservices/args.py on lines 280..282
            webservices/args.py on lines 322..324

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                'amendment_indicator': fields.List(
                    IStr(validate=validate.OneOf(['', 'N', 'A', 'T', 'C' , 'M', 'S'])),
                    description=docs.AMENDMENT_INDICATOR),
            Severity: Major
            Found in webservices/args.py and 3 other locations - About 35 mins to fix
            webservices/args.py on lines 228..230
            webservices/args.py on lines 232..234
            webservices/args.py on lines 322..324

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                        delete = sa.delete(master_table).where(
                            master_table.c.get(cls.primary).in_(delete_select)
            Severity: Minor
            Found in webservices/partition/base.py and 1 other location - About 35 mins to fix
            webservices/partition/base.py on lines 134..135

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                if kwargs.get('mur_respondents'):
                    must_clauses.append(Q('match', respondents=kwargs.get('mur_respondents')))
            Severity: Major
            Found in webservices/resources/legal.py and 6 other locations - About 35 mins to fix
            webservices/resources/legal.py on lines 156..157
            webservices/resources/legal.py on lines 160..161
            webservices/resources/legal.py on lines 162..163
            webservices/resources/legal.py on lines 214..215
            webservices/resources/legal.py on lines 223..224
            webservices/resources/legal.py on lines 226..227

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

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

                if kwargs.get('mur_dispositions'):
                    must_clauses.append(Q('term', disposition__data__disposition=kwargs.get('mur_dispositions')))
            Severity: Major
            Found in webservices/resources/legal.py and 6 other locations - About 35 mins to fix
            webservices/resources/legal.py on lines 156..157
            webservices/resources/legal.py on lines 158..159
            webservices/resources/legal.py on lines 162..163
            webservices/resources/legal.py on lines 214..215
            webservices/resources/legal.py on lines 223..224
            webservices/resources/legal.py on lines 226..227

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 33.

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

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

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

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

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language