ICTU/quality-time

View on GitHub

Showing 142 of 681 total issues

Function summarizeReportsOnDate has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function summarizeReportsOnDate(dataModel, settings, reports, measurements, date, tag) {
Severity: Minor
Found in components/frontend/src/report/report_utils.js - About 45 mins to fix

    Function check_source_configuration has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def check_source_configuration(self, source_key, configuration) -> None:
            """Check that the metrics listed by the source configuration have the source as supported source."""
            for configuration_key, configuration_value in configuration.items():
                for metric_key in configuration_value.metrics:
                    if metric_key not in self.metrics:
    Severity: Minor
    Found in components/shared_code/src/shared_data_model/meta/data_model.py - About 45 mins 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 getMetricResponseDeadline has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export function getMetricResponseDeadline(metric, report) {
        let deadline = null
        const status = metric.status || "unknown"
        if (status === "debt_target_met") {
            if (metric.debt_end_date) {
    Severity: Minor
    Found in components/frontend/src/utils.js - About 45 mins 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 labelDetails has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function labelDetails(issueStatus, settings) {
        let details = [<Label.Detail key="name">{issueStatus.name || "?"}</Label.Detail>]
        if (issueStatus.summary && settings.showIssueSummary.value) {
            details.push(<Label.Detail key="summary">{issueStatus.summary}</Label.Detail>)
        }
    Severity: Minor
    Found in components/frontend/src/issue/IssueStatus.js - About 45 mins 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

    Consider simplifying this complex logical expression.
    Open

            if parameter_info.type == "multiple_choice":
                # If the user didn't pick any values, select the default value if any, otherwise select all values:
                default_value = parameter_info.default_value
                value = self.__parameters.get(parameter_key) or default_value or parameter_info.values or []
                # Ensure all values picked by the user are still allowed. Remove any values that are no longer allowed:
    Severity: Major
    Found in components/collector/src/model/parameters.py - About 40 mins to fix

      Function getMetricResponseOverrun has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      export function getMetricResponseOverrun(metric_uuid, metric, report, measurements, dataModel) {
      Severity: Minor
      Found in components/frontend/src/utils.js - About 35 mins to fix

        Function onDragStop has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function onDragStop(newLayout, _oldItem, _newItem, _placeholder, event) {
        Severity: Minor
        Found in components/frontend/src/dashboard/CardDashboard.js - About 35 mins to fix

          Function metricStatusOnDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function metricStatusOnDate(metric_uuid, metric, measurements, date, dataModel) {
          Severity: Minor
          Found in components/frontend/src/report/report_utils.js - About 35 mins to fix

            Function metricValueAndStatusOnDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function metricValueAndStatusOnDate(dataModel, metric, metric_uuid, measurements, date) {
            Severity: Minor
            Found in components/frontend/src/subject/SubjectTableRow.js - About 35 mins to fix

              Function set_entity_attribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def set_entity_attribute(
              Severity: Minor
              Found in components/api_server/src/routes/measurement.py - About 35 mins to fix

                Function prepare_documents_for_insertion has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def prepare_documents_for_insertion(
                Severity: Minor
                Found in components/api_server/src/database/reports.py - About 35 mins to fix

                  Function set_source_parameter has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  export function set_source_parameter(source_uuid, key, value, edit_scope, reload) {
                  Severity: Minor
                  Found in components/frontend/src/api/source.js - About 35 mins to fix

                    Function onDragStart has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        function onDragStart(_currentLayout, _oldItem, _newItem, _placeholder, event) {
                    Severity: Minor
                    Found in components/frontend/src/dashboard/CardDashboard.js - About 35 mins to fix

                      Function access_parameters has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def access_parameters(
                      Severity: Minor
                      Found in components/shared_code/src/shared_data_model/parameters.py - About 35 mins to fix

                        Function change_sonarqube_parameter has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def change_sonarqube_parameter(
                        Severity: Minor
                        Found in components/api_server/src/initialization/migrations.py - About 35 mins to fix

                          Function summarizeMetricsOnDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          export function summarizeMetricsOnDate(dataModel, metrics, measurements, date, tag) {
                          Severity: Minor
                          Found in components/frontend/src/report/report_utils.js - About 35 mins to fix

                            Function sourceEntitiesHeaders has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                entityAttributes,
                                hideIgnoredEntities,
                                metricEntities,
                                setHideIgnoredEntities,
                                sortProps,
                            Severity: Minor
                            Found in components/frontend/src/source/SourceEntities.js - About 35 mins to fix

                              Function metrics has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def metrics(report, metric_types: Sequence[str] | None = None):
                                  """Yield the metrics in the report, optionally filtered by metric type."""
                                  for subject in subjects(report):
                                      for metric in subject["metrics"].values():
                                          if not metric_types or metric["type"] in metric_types:
                              Severity: Minor
                              Found in components/api_server/src/initialization/migrations.py - About 35 mins 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 SourceParameters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function SourceParameters({ changed_param_keys, metric, reload, report, source, source_uuid }) {
                                  const dataModel = useContext(DataModel)
                                  const metricUnit = formatMetricScaleAndUnit(metric, dataModel)
                                  const allParameters = dataModel.sources[source.type].parameters
                                  const parameterLayout = dataModel.sources[source.type].parameter_layout ?? DEFAULT_LAYOUT
                              Severity: Minor
                              Found in components/frontend/src/source/SourceParameters.js - About 35 mins 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 MeasurementTarget has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export function MeasurementTarget({ metric }) {
                                  const dataModel = useContext(DataModel)
                                  if (metric?.evaluate_targets === false) {
                                      return null
                                  }
                              Severity: Minor
                              Found in components/frontend/src/measurement/MeasurementTarget.js - About 35 mins 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

                              Severity
                              Category
                              Status
                              Source
                              Language