Showing 126 of 683 total issues
Function access_parameters
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def access_parameters(
Function prepare_documents_for_insertion
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def prepare_documents_for_insertion(
Function onDragStart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function onDragStart(_currentLayout, _oldItem, _newItem, _placeholder, event) {
Function onDragStop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function onDragStop(newLayout, _oldItem, _newItem, _placeholder, event) {
Function set_entity_attribute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_entity_attribute(
Function summarizeTagOnDate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function summarizeTagOnDate(report, measurements, tag, date, dataModel) {
Function summarizeReportOnDate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function summarizeReportOnDate(report, measurements, date, hiddenTags, dataModel) {
Function set_source_parameter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function set_source_parameter(source_uuid, key, value, edit_scope, reload) {
Function getMetricResponseOverrun
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function getMetricResponseOverrun(metric_uuid, metric, report, measurements, dataModel) {
Function __calculate_status
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __calculate_status(self, value: str | None) -> Status | None:
"""Determine the status of the measurement."""
target, near_target, debt_target = (
self.get("target"),
self.get("near_target"),
- 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 metrics
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def metrics(report, metric_types: Sequence[str] | None = None):
"""Yield the metrics in the report, optionally filtered by metric type."""
for subject in subjects(report):
for metric in subject["metrics"].values():
if not metric_types or metric["type"] in metric_types:
- 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 MetricDetails
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function MetricDetails({
changed_fields,
isFirstMetric,
isLastMetric,
metric_uuid,
- 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 post_reports_overview_attribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def post_reports_overview_attribute(reports_attribute: str, database: Database):
"""Set a reports overview attribute."""
new_value = dict(bottle.request.json)[reports_attribute]
if reports_attribute == "comment" and new_value:
new_value = sanitize_html(new_value)
- 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 match_string_or_regular_expression
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def match_string_or_regular_expression(string: str, strings_and_or_regular_expressions: Collection[str]) -> bool:
"""Return whether the string is equal to one of the strings or matches one of the regular expressions."""
for string_or_regular_expression in strings_and_or_regular_expressions:
if is_regexp(string_or_regular_expression):
if re.match(string_or_regular_expression, string):
- 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 metric_section
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def metric_section(metric_key: str, metric: Metric, level: int) -> str:
"""Return the metric as Markdown section."""
markdown = markdown_header(metric.name, level=level, index=True)
markdown += markdown_paragraph(metric.description)
name = decapitalize(metric.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 MeasurementTarget
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function MeasurementTarget({ metric }) {
const dataModel = useContext(DataModel)
if (metric?.evaluate_targets === false) {
return null
}
- 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 SourceParameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function SourceParameters({ changed_param_keys, metric, reload, report, source, source_uuid }) {
const dataModel = useContext(DataModel)
const metricUnit = formatMetricScaleAndUnit(metric, dataModel)
const allParameters = dataModel.sources[source.type].parameters
const parameterLayout = dataModel.sources[source.type].parameter_layout ?? DEFAULT_LAYOUT
- 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 _include_entity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _include_entity(self, entity: Entity) -> bool:
"""Return whether the card should be included."""
def card_is_inactive() -> bool:
"""Return whether the card is inactive."""
- 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
Avoid too many return
statements within this function. Open
return <StringInput {...parameter_props} />
Avoid too many return
statements within this function. Open
return <MultipleChoiceInput {...parameter_props} options={dropdownOptions(parameter_values)} allowAdditions />