Showing 142 of 681 total issues
File metrics.py
has 720 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Data model metrics."""
from .meta.metric import Addition, Direction, Metric, Tag, Unit
SIG_TUVIT_EVALUATION_CRITERIA = (
File utils.test.js
has 482 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { EDIT_ENTITY_PERMISSION, EDIT_REPORT_PERMISSION } from "./context/Permissions"
import { defaultDesiredResponseTimes } from "./defaults"
import {
addCounts,
capitalize,
File sonarqube.py
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""SonarQube source."""
from pydantic import HttpUrl
from shared_data_model.meta.base import StrEnum
File utils.js
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { arrayOf, number, objectOf, oneOf, string } from "prop-types"
import { PERMISSIONS } from "./context/Permissions"
import { defaultDesiredResponseTimes } from "./defaults"
import { STATUSES_NOT_REQUIRING_ACTION } from "./metric/status"
File Button.js
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { array, arrayOf, bool, func, string } from "prop-types"
import { useState } from "react"
import { Icon, Input } from "semantic-ui-react"
import { Button, Checkbox, Dropdown, Popup } from "../semantic_ui_react_wrappers"
File SubjectTableRow.js
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { bool, func, number, object, string } from "prop-types"
import { useContext } from "react"
import { DarkMode } from "../context/DarkMode"
import { DataModel } from "../context/DataModel"
File SubjectTableHeader.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { bool, func } from "prop-types"
import { useContext } from "react"
import { List, Table } from "semantic-ui-react"
import { DarkMode } from "../context/DarkMode"
File SourceEntities.js
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import "./SourceEntities.css"
import { bool, func, object, string } from "prop-types"
import { useContext, useState } from "react"
import { Message } from "semantic-ui-react"
File Button.test.js
has 329 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { act, fireEvent, render, screen, waitFor } from "@testing-library/react"
import userEvent from "@testing-library/user-event"
import {
AddButton,
File Target.test.js
has 319 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { render, screen, waitFor } from "@testing-library/react"
import userEvent from "@testing-library/user-event"
import * as fetch_server_api from "../api/fetch_server_api"
import { DataModel } from "../context/DataModel"
File quality_time.py
has 310 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Quality-time source."""
from pydantic import HttpUrl
from shared_data_model.meta.entity import (
File source_collector.py
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Source collector base classes."""
import asyncio
import logging
import traceback
File Target.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Box, Stack, Typography } from "@mui/material"
import { bool, func, oneOf, string } from "prop-types"
import { useContext } from "react"
import { Segment } from "semantic-ui-react"
Function sortMetrics
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sortMetrics(dataModel, metrics, sortDirection, sortColumn, report, measurements) {
const status_order = {
unknown: "0",
target_not_met: "1",
near_target_met: "2",
File IssueStatus.test.js
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { render, screen, waitFor } from "@testing-library/react"
import userEvent from "@testing-library/user-event"
import history from "history/browser"
import { createTestableSettings } from "../__fixtures__/fixtures"
File ReportTitle.test.js
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { act, fireEvent, render, screen } from "@testing-library/react"
import userEvent from "@testing-library/user-event"
import history from "history/browser"
import { createTestableSettings } from "../__fixtures__/fixtures"
File azure_devops.py
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Azure DevOps source."""
from pydantic import HttpUrl
from shared_data_model.meta.entity import Color, Entity, EntityAttribute, EntityAttributeType
File create_reference_md.py
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Script to convert the data model in a Markdown file."""
import pathlib
import re
from typing import Literal
Function EditableIntegerInput
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
function EditableIntegerInput(props) {
let { allowEmpty, editableLabel, label, min, prefix, set_value, unit, ...otherProps } = props
const initialValue = props.value || (allowEmpty ? "" : 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 EditableIntegerInput
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function EditableIntegerInput(props) {
let { allowEmpty, editableLabel, label, min, prefix, set_value, unit, ...otherProps } = props
const initialValue = props.value || (allowEmpty ? "" : 0)
const [value, setValue] = useState(initialValue)
const minValue = min || 0