Showing 121 of 349 total issues
Avoid too many return
statements within this function. Open
return this.renderer.html(html);
Avoid too many return
statements within this function. Open
return Parser.parse(Lexer.lex(src, opt), opt);
Avoid too many return
statements within this function. Open
return this.renderer.listitem(body);
Avoid too many return
statements within this function. Open
return this.renderer.listitem(body);
Avoid too many return
statements within this function. Open
return this.renderer.table(header, body);
Avoid too many return
statements within this function. Open
return this.renderer.paragraph(this.parseText());
Function fetch_seek_page
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def fetch_seek_page(query, kwargs, index_column, clear=False, count=None, cap=100, eager=True):
paginator = fetch_seek_paginator(query, kwargs, index_column, clear=clear, count=count, cap=cap)
if paginator.sort_column is not None:
sort_index = kwargs['last_{0}'.format(paginator.sort_column[2])]
null_sort_by = paginator.sort_column[0]
- Read upRead up
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 getParamByName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
getParamByName: function(name) {
var i;
if (this.model.parameters) {
for(i = 0; i < this.model.parameters.length; i++) {
if (this.model.parameters[i].name === name) {
- Read upRead up
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 deploy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deploy(ctx, space=None, branch=None, login=None, yes=False):
"""Deploy app to Cloud Foundry. Log in using credentials stored per environment
like `FEC_CF_USERNAME_DEV` and `FEC_CF_PASSWORD_DEV`; push to either `space` or t
he space detected from the name and tags of the current branch. Note: Must pass `space`
or `branch` if repo is in detached HEAD mode, e.g. when running on Travis.
- Read upRead up
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 parse_ao_citations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_ao_citations(text, ao_component_to_name_map):
matches = set()
if text:
for citation in AO_CITATION_REGEX.finditer(text):
- Read upRead up
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 build_query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_query(self, **kwargs):
query = super().build_query(**kwargs)
if {'receipts', '-receipts'}.intersection(kwargs.get('sort', [])) and 'q' not in kwargs:
raise exceptions.ApiError(
- Read upRead up
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 build_query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_query(self, committee_id=None, candidate_id=None, cycle=None, **kwargs):
query = models.CommitteeHistory.query
if committee_id:
query = query.filter(models.CommitteeHistory.committee_id == committee_id)
- Read upRead up
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 related
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def related(related_model, id_label, related_id_label=None, cycle_label=None,
related_cycle_label=None, use_modulus=True):
from webservices.common.models import db
related_model = get_model(related_model)
related_id_label = related_id_label or id_label
- Read upRead up
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 get_citations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_citations(ao_names):
ao_component_to_name_map = {tuple(map(int, a.split('-'))): a for a in ao_names}
logger.info("Getting citations...")
- Read upRead up
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 limit_remote_addr
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def limit_remote_addr():
"""If `FEC_API_WHITELIST_IPS` is set, reject all requests that are not
routed through the API Umbrella.
"""
falses = (False, 'False', 'false', 'f')
- Read upRead up
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 build_query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_query(self, committee_id=None, **kwargs):
query = super().build_query(committee_id=committee_id, **kwargs)
election_full = kwargs.get('election_full')
if election_full and not (kwargs.get('candidate_id') or kwargs.get('office')):
raise exceptions.ApiError(
- Read upRead up
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 _get_index_values
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _get_index_values(self, result):
"""Get index values from last result, to be used in seeking to the next
page. Optionally include sort values, if any.
"""
ret = {
- Read upRead up
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 build_query
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_query(self, committee_id=None, committee_type=None, **kwargs):
reports_class, reports_schema = reports_schema_map.get(
self._resolve_committee_type(
committee_id=committee_id,
committee_type=committee_type,
- Read upRead up
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 check_election_arguments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_election_arguments(kwargs):
for arg in office_args_required:
if kwargs.get(arg) is None:
raise exceptions.ApiError(
'Required parameter "{0}" not found.'.format(arg),
- Read upRead up
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 render_ical
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render_ical(rows, schema):
calendar = Calendar()
for row in rows:
event = Event()
for key, value in row.items():
- Read upRead up
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"