Showing 126 of 683 total issues
File gitlab.py
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""GitLab source."""
from pydantic import HttpUrl
from shared_data_model.meta.entity import Color, Entity, EntityAttribute, EntityAttributeType
Function EditableIntegerInput
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function EditableIntegerInput(props) {
let { editableLabel, label, min, prefix, set_value, unit, ...otherProps } = props
const initialValue = props.value || 0
const [value, setValue] = useState(initialValue)
const minValue = min || 0
Function SourceEntityAttribute
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function SourceEntityAttribute({ entity, entityAttribute }) {
let cellContents = entity[entityAttribute.key] ?? ""
if (typeof cellContents === "string" && cellContents.length >= 250) {
cellContents = cellContents.slice(0, 247) + "..."
}
- 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
File Menubar.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
import "./Menubar.css"
import { element, func, string } from "prop-types"
import { useEffect, useState } from "react"
import FocusLock from "react-focus-lock"
File MetricDetails.js
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { bool, func, string } from "prop-types"
import { useContext, useEffect, useState } from "react"
import { Icon, Menu } from "semantic-ui-react"
import { get_metric_measurements } from "../api/measurement"
File create_reference_md.py
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Script to convert the data model in a Markdown file."""
import pathlib
import re
from typing import Literal
File IssueTracker.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { func } from "prop-types"
import { useContext, useEffect, useState } from "react"
import { Grid, Header, Message } from "semantic-ui-react"
import { get_report_issue_tracker_options, set_report_issue_tracker_attribute } from "../api/report"
Function MultipleChoiceInput
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function MultipleChoiceInput(props) {
let { allowAdditions, editableLabel, onSearchChange, required, set_value, requiredPermissions, ...otherProps } =
props
const [values, setValues] = useState(props.value || [])
const [searchQuery, setSearchQuery] = useState("")
Function EditableIntegerInput
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function EditableIntegerInput(props) {
let { editableLabel, label, min, prefix, set_value, unit, ...otherProps } = props
const initialValue = props.value || 0
const [value, setValue] = useState(initialValue)
const minValue = min || 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 groups
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
const groups = Object.values(parameterLayout).map((parameterGroup) => {
const parameterKeys = applicableParameters(allParameters, remainingParameters, parameterGroup, metric)
if (parameterKeys.length === 0) {
return null
}
Function issuePopupContent
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function issuePopupContent(issueStatus) {
let popupContent = <TimeAgoWithDate date={issueStatus.created}>Created</TimeAgoWithDate>
if (issueStatus.updated) {
popupContent = (
<>
Function AppUI
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function AppUI({
changed_fields,
dataModel,
email,
handleDateChange,
- 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 renderMetricDetails
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function renderMetricDetails(stopFilteringAndSorting, connection_error) {
measurement_api.get_metric_measurements.mockImplementation(() =>
Promise.resolve({
ok: true,
measurements: [
Function MeasurementValue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export function MeasurementValue({ metric, reportDate }) {
const dataModel = useContext(DataModel)
const metricValue = getMetricValue(metric, dataModel)
let value = metricValue || "?"
const scale = getMetricScale(metric, dataModel)
- 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 parameter_description
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def parameter_description(parameter: Parameter) -> str:
"""Return the Markdown version of the parameter."""
short_name = parameter.short_name
help_text = " " + parameter.help if parameter.help else ""
if parameter.type in ("single_choice", "multiple_choice"):
- 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_based_on_tags
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _include_entity_based_on_tags(self, entity: Entity) -> bool:
"""Return whether to include the entity based on the tags."""
tags = entity["tags"].split(", ")
if tags_to_include := self._parameter("tags_to_include"):
for tag in tags:
- 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 renderIssueStatus
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function renderIssueStatus({
connectionError = false,
created = true,
due = false,
issueTrackerMissing = false,
- 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_notifications
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_notifications(
self,
reports: list[Report],
measurements: list[Measurement],
most_recent_measurement_seen: datetime,
- 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 popupText
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function popupText(metric, debtEndDateInThePast, allIssuesDone, dataModel) {
const unit = formatMetricScaleAndUnit(metric, dataModel)
const metricDirection = formatMetricDirection(metric, dataModel)
let debtEndDateText = ""
let endDate
- 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 Input
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Input(props) {
let { editableLabel, label, error, prefix, required, set_value, warning, ...otherProps } = props
const initialValue = props.value || ""
const [value, setValue] = useState(initialValue)