ICTU/quality-time

View on GitHub

Showing 126 of 683 total issues

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 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 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 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 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 summarizeTagOnDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

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

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

              function summarizeReportOnDate(report, measurements, date, hiddenTags, dataModel) {
              Severity: Minor
              Found in components/frontend/src/report/ReportsOverviewDashboard.js - 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 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 __calculate_status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def __calculate_status(self, value: str | None) -> Status | None:
                            """Determine the status of the measurement."""
                            target, near_target, debt_target = (
                                self.get("target"),
                                self.get("near_target"),
                    Severity: Minor
                    Found in components/shared_code/src/shared/model/measurement.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 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 MetricDetails has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function MetricDetails({
                        changed_fields,
                        isFirstMetric,
                        isLastMetric,
                        metric_uuid,
                    Severity: Minor
                    Found in components/frontend/src/metric/MetricDetails.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 post_reports_overview_attribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def post_reports_overview_attribute(reports_attribute: str, database: Database):
                        """Set a reports overview attribute."""
                        new_value = dict(bottle.request.json)[reports_attribute]
                        if reports_attribute == "comment" and new_value:
                            new_value = sanitize_html(new_value)
                    Severity: Minor
                    Found in components/api_server/src/routes/reports_overview.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 match_string_or_regular_expression has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def match_string_or_regular_expression(string: str, strings_and_or_regular_expressions: Collection[str]) -> bool:
                        """Return whether the string is equal to one of the strings or matches one of the regular expressions."""
                        for string_or_regular_expression in strings_and_or_regular_expressions:
                            if is_regexp(string_or_regular_expression):
                                if re.match(string_or_regular_expression, string):
                    Severity: Minor
                    Found in components/collector/src/collector_utilities/functions.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 metric_section has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def metric_section(metric_key: str, metric: Metric, level: int) -> str:
                        """Return the metric as Markdown section."""
                        markdown = markdown_header(metric.name, level=level, index=True)
                        markdown += markdown_paragraph(metric.description)
                        name = decapitalize(metric.name)
                    Severity: Minor
                    Found in docs/src/create_reference_md.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 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

                    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 _include_entity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def _include_entity(self, entity: Entity) -> bool:
                            """Return whether the card should be included."""
                    
                            def card_is_inactive() -> bool:
                                """Return whether the card is inactive."""
                    Severity: Minor
                    Found in components/collector/src/source_collectors/trello/issues.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

                    Avoid too many return statements within this function.
                    Open

                            return <StringInput {...parameter_props} />
                    Severity: Major
                    Found in components/frontend/src/source/SourceParameter.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return <MultipleChoiceInput {...parameter_props} options={dropdownOptions(parameter_values)} allowAdditions />
                      Severity: Major
                      Found in components/frontend/src/source/SourceParameter.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language