ICTU/quality-time

View on GitHub

Showing 142 of 681 total issues

File metrics.py has 720 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Data model metrics."""

from .meta.metric import Addition, Direction, Metric, Tag, Unit

SIG_TUVIT_EVALUATION_CRITERIA = (
Severity: Major
Found in components/shared_code/src/shared_data_model/metrics.py - About 1 day to fix

    File utils.test.js has 482 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { EDIT_ENTITY_PERMISSION, EDIT_REPORT_PERMISSION } from "./context/Permissions"
    import { defaultDesiredResponseTimes } from "./defaults"
    import {
        addCounts,
        capitalize,
    Severity: Minor
    Found in components/frontend/src/utils.test.js - About 7 hrs to fix

      File sonarqube.py has 458 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """SonarQube source."""
      
      from pydantic import HttpUrl
      
      from shared_data_model.meta.base import StrEnum
      Severity: Minor
      Found in components/shared_code/src/shared_data_model/sources/sonarqube.py - About 7 hrs to fix

        File utils.js has 393 lines of code (exceeds 250 allowed). Consider refactoring.
        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"
        Severity: Minor
        Found in components/frontend/src/utils.js - About 5 hrs to fix

          File Button.js has 376 lines of code (exceeds 250 allowed). Consider refactoring.
          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"
          Severity: Minor
          Found in components/frontend/src/widgets/Button.js - About 5 hrs to fix

            File SubjectTableRow.js has 366 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import { bool, func, number, object, string } from "prop-types"
            import { useContext } from "react"
            
            import { DarkMode } from "../context/DarkMode"
            import { DataModel } from "../context/DataModel"
            Severity: Minor
            Found in components/frontend/src/subject/SubjectTableRow.js - About 4 hrs to fix

              File SubjectTableHeader.js has 342 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import { bool, func } from "prop-types"
              import { useContext } from "react"
              import { List, Table } from "semantic-ui-react"
              
              import { DarkMode } from "../context/DarkMode"
              Severity: Minor
              Found in components/frontend/src/subject/SubjectTableHeader.js - About 4 hrs to fix

                File SourceEntities.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import "./SourceEntities.css"
                
                import { bool, func, object, string } from "prop-types"
                import { useContext, useState } from "react"
                import { Message } from "semantic-ui-react"
                Severity: Minor
                Found in components/frontend/src/source/SourceEntities.js - About 4 hrs to fix

                  File Button.test.js has 329 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { act, fireEvent, render, screen, waitFor } from "@testing-library/react"
                  import userEvent from "@testing-library/user-event"
                  
                  import {
                      AddButton,
                  Severity: Minor
                  Found in components/frontend/src/widgets/Button.test.js - About 3 hrs to fix

                    File Target.test.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                    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"
                    Severity: Minor
                    Found in components/frontend/src/metric/Target.test.js - About 3 hrs to fix

                      File quality_time.py has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """Quality-time source."""
                      
                      from pydantic import HttpUrl
                      
                      from shared_data_model.meta.entity import (
                      Severity: Minor
                      Found in components/shared_code/src/shared_data_model/sources/quality_time.py - About 3 hrs to fix

                        File source_collector.py has 307 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        """Source collector base classes."""
                        
                        import asyncio
                        import logging
                        import traceback
                        Severity: Minor
                        Found in components/collector/src/base_collectors/source_collector.py - About 3 hrs to fix

                          File Target.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
                          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"
                          
                          
                          Severity: Minor
                          Found in components/frontend/src/metric/Target.js - About 3 hrs to fix

                            Function sortMetrics has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function sortMetrics(dataModel, metrics, sortDirection, sortColumn, report, measurements) {
                                const status_order = {
                                    unknown: "0",
                                    target_not_met: "1",
                                    near_target_met: "2",
                            Severity: Major
                            Found in components/frontend/src/subject/Subject.js - About 2 hrs to fix

                              File IssueStatus.test.js has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                              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"
                              Severity: Minor
                              Found in components/frontend/src/issue/IssueStatus.test.js - About 2 hrs to fix

                                File ReportTitle.test.js has 281 lines of code (exceeds 250 allowed). Consider refactoring.
                                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"
                                Severity: Minor
                                Found in components/frontend/src/report/ReportTitle.test.js - About 2 hrs to fix

                                  File azure_devops.py has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  """Azure DevOps 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/azure_devops.py - About 2 hrs to fix

                                    File create_reference_md.py has 269 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

                                      Function EditableIntegerInput has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                      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
                                      Severity: Minor
                                      Found in components/frontend/src/fields/IntegerInput.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

                                      Function EditableIntegerInput has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                                      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
                                      Severity: Major
                                      Found in components/frontend/src/fields/IntegerInput.js - About 2 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language