ICTU/quality-time

View on GitHub

Showing 123 of 674 total issues

File metrics.py has 713 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 sonarqube.py has 440 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 6 hrs to fix

      File ReportTitle.js has 426 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { func, string } from "prop-types"
      import { Grid, Icon, Menu } from "semantic-ui-react"
      
      import { delete_report, set_report_attribute } from "../api/report"
      import { activeTabIndex, tabChangeHandler } from "../app_ui_settings"
      Severity: Minor
      Found in components/frontend/src/report/ReportTitle.js - About 6 hrs to fix

        File SettingsPanel.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import "./SettingsPanel.css"
        
        import { bool, func, number, string } from "prop-types"
        import { Header, Menu, Segment } from "semantic-ui-react"
        
        
        Severity: Minor
        Found in components/frontend/src/header_footer/SettingsPanel.js - About 5 hrs to fix

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

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

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

            import { array, 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 336 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 Button.js has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { array, bool, func, string } from "prop-types"
                import { useRef, useState } from "react"
                import { Icon, Input } from "semantic-ui-react"
                
                import { Button, Dropdown, Label, Popup } from "../semantic_ui_react_wrappers"
                Severity: Minor
                Found in components/frontend/src/widgets/Button.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 utils.js has 316 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 { metricPropType, reportPropType, reportsPropType, stringsPropType } from "./sharedPropTypes"
                    Severity: Minor
                    Found in components/frontend/src/utils.js - About 3 hrs to fix

                      File source_collector.py has 312 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 quality_time.py has 306 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 ReportTitle.test.js has 287 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

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

                            function sortMetrics(datamodel, metrics, sortDirection, sortColumn, report, measurements) {
                                const status_order = {
                                    "": "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 279 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 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 Button.test.js has 272 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 2 hrs to fix

                                    Function SourceEntities has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export function SourceEntities({ metric, metric_uuid, reload, report, source }) {
                                        const dataModel = useContext(DataModel)
                                        const [hideIgnoredEntities, setHideIgnoredEntities] = useState(false)
                                        const [sortColumn, setSortColumn] = useState(null)
                                        const [columnType, setColumnType] = useState("text")
                                    Severity: Minor
                                    Found in components/frontend/src/source/SourceEntities.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 Target.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { bool, func, oneOf, string } from "prop-types"
                                    import { useContext } from "react"
                                    import { Segment } from "semantic-ui-react"
                                    
                                    import { set_metric_attribute } from "../api/metric"
                                    Severity: Minor
                                    Found in components/frontend/src/metric/Target.js - About 2 hrs to fix

                                      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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language