ICTU/quality-time

View on GitHub

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
Severity: Minor
Found in components/shared_code/src/shared_data_model/sources/gitlab.py - About 2 hrs to fix

    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
    Severity: Major
    Found in components/frontend/src/fields/IntegerInput.js - About 2 hrs to fix

      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) + "..."
          }
      Severity: Minor
      Found in components/frontend/src/source/SourceEntityAttribute.js - About 2 hrs to fix

      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"
      Severity: Minor
      Found in components/frontend/src/header_footer/Menubar.js - About 2 hrs to fix

        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"
        Severity: Minor
        Found in components/frontend/src/metric/MetricDetails.js - About 2 hrs to fix

          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
          Severity: Minor
          Found in docs/src/create_reference_md.py - About 2 hrs to fix

            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"
            Severity: Minor
            Found in components/frontend/src/report/IssueTracker.js - About 2 hrs to fix

              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("")
              Severity: Minor
              Found in components/frontend/src/fields/MultipleChoiceInput.js - About 1 hr to fix

                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
                Severity: Minor
                Found in components/frontend/src/fields/IntegerInput.js - About 1 hr to fix

                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
                        }
                Severity: Minor
                Found in components/frontend/src/source/SourceParameters.js - About 1 hr to fix

                  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 = (
                              <>
                  Severity: Minor
                  Found in components/frontend/src/issue/IssueStatus.js - About 1 hr to fix

                    Function AppUI has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function AppUI({
                        changed_fields,
                        dataModel,
                        email,
                        handleDateChange,
                    Severity: Minor
                    Found in components/frontend/src/AppUI.js - About 1 hr to fix

                    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: [
                    Severity: Minor
                    Found in components/frontend/src/metric/MetricDetails.test.js - About 1 hr to fix

                      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)
                      Severity: Minor
                      Found in components/frontend/src/measurement/MeasurementValue.js - About 1 hr to fix

                      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"):
                      Severity: Minor
                      Found in docs/src/create_reference_md.py - About 1 hr to fix

                      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:
                      Severity: Minor
                      Found in components/collector/src/source_collectors/axe_core/violations.py - About 1 hr to fix

                      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,
                      Severity: Minor
                      Found in components/frontend/src/issue/IssueStatus.test.js - About 1 hr to fix

                      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,
                      Severity: Minor
                      Found in components/notifier/src/strategies/notification_strategy.py - About 1 hr to fix

                      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
                      Severity: Minor
                      Found in components/frontend/src/measurement/MeasurementTarget.js - About 1 hr to fix

                      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)
                      
                      
                      Severity: Minor
                      Found in components/frontend/src/fields/Input.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language