Showing 142 of 681 total issues
Function summarizeReportsOnDate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function summarizeReportsOnDate(dataModel, settings, reports, measurements, date, tag) {
Function check_source_configuration
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def check_source_configuration(self, source_key, configuration) -> None:
"""Check that the metrics listed by the source configuration have the source as supported source."""
for configuration_key, configuration_value in configuration.items():
for metric_key in configuration_value.metrics:
if metric_key not in self.metrics:
- 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 getMetricResponseDeadline
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getMetricResponseDeadline(metric, report) {
let deadline = null
const status = metric.status || "unknown"
if (status === "debt_target_met") {
if (metric.debt_end_date) {
- 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 labelDetails
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function labelDetails(issueStatus, settings) {
let details = [<Label.Detail key="name">{issueStatus.name || "?"}</Label.Detail>]
if (issueStatus.summary && settings.showIssueSummary.value) {
details.push(<Label.Detail key="summary">{issueStatus.summary}</Label.Detail>)
}
- 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
Consider simplifying this complex logical expression. Open
if parameter_info.type == "multiple_choice":
# If the user didn't pick any values, select the default value if any, otherwise select all values:
default_value = parameter_info.default_value
value = self.__parameters.get(parameter_key) or default_value or parameter_info.values or []
# Ensure all values picked by the user are still allowed. Remove any values that are no longer allowed:
Function getMetricResponseOverrun
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function getMetricResponseOverrun(metric_uuid, metric, report, measurements, dataModel) {
Function onDragStop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function onDragStop(newLayout, _oldItem, _newItem, _placeholder, event) {
Function metricStatusOnDate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function metricStatusOnDate(metric_uuid, metric, measurements, date, dataModel) {
Function metricValueAndStatusOnDate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function metricValueAndStatusOnDate(dataModel, metric, metric_uuid, measurements, date) {
Function set_entity_attribute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def set_entity_attribute(
Function prepare_documents_for_insertion
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def prepare_documents_for_insertion(
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 onDragStart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function onDragStart(_currentLayout, _oldItem, _newItem, _placeholder, event) {
Function access_parameters
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def access_parameters(
Function change_sonarqube_parameter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def change_sonarqube_parameter(
Function summarizeMetricsOnDate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function summarizeMetricsOnDate(dataModel, metrics, measurements, date, tag) {
Function sourceEntitiesHeaders
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
entityAttributes,
hideIgnoredEntities,
metricEntities,
setHideIgnoredEntities,
sortProps,
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 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 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"