abrain/einsatzverwaltung

View on GitHub

Showing 247 of 250 total issues

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

    private function upgrade162()
    {
        global $wpdb;

        /**
Severity: Minor
Found in src/Update.php - 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 upgrade170 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function upgrade170()
    {
        global $wpdb;

        /**
Severity: Minor
Found in src/Update.php - 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 displayMetaBoxVehicles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function displayMetaBoxVehicles(WP_Post $post)
    {
        $vehicleTaxonomy = get_taxonomy(Vehicle::getSlug());
        if (empty($vehicleTaxonomy)) {
            return;
Severity: Minor
Found in src/Admin/ReportEditScreen.php - 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 renderDateOptions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function renderDateOptions()
    {
        global $wpdb, $wp_locale;

        $months = $wpdb->get_results($wpdb->prepare("
Severity: Minor
Found in src/Export/Tool.php - 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 runImport has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function runImport($preparedInsertArgs, $source, $yearsAffected, $importStatus)
    {
        // Für die Dauer des Imports sollen die laufenden Nummern nicht aktuell gehalten werden, da dies die Performance
        // stark beeinträchtigt
        if ($source->isPublishReports()) {
Severity: Minor
Found in src/Import/Helper.php - 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 upgrade113 has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function upgrade113()
    {
        if (!function_exists('get_editable_roles')) {
            require_once(ABSPATH . 'wp-admin/includes/user.php');
        }
Severity: Minor
Found in src/Update.php - 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 method.
Open

            return;
Severity: Major
Found in src/Data.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return false;
    Severity: Major
    Found in src/Import/Sources/Csv.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return AnnotationIconBar::getInstance()->render($report->getPostId());
      Severity: Major
      Found in src/Admin/ReportListTable.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return array_merge($resourcesByName, $resourcesByAlias);
        Severity: Major
        Found in src/DataAccess/ReportInserter.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return false;
          Severity: Major
          Found in src/Frontend.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return;
            Severity: Major
            Found in src/Import/Tool.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return $vehicle->term_id;
              Severity: Major
              Found in src/Admin/ReportEditScreen.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return join(', ', $vehicleLinks);
                Severity: Major
                Found in src/Admin/ReportListTable.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return $header . '<hr>' . $content;
                  Severity: Major
                  Found in src/Frontend.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return true;
                    Severity: Major
                    Found in src/Import/Sources/Csv.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return join(', ', $unitLinks);
                      Severity: Major
                      Found in src/Admin/ReportListTable.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                return $newOutput;
                        Severity: Major
                        Found in src/Admin/ReportEditScreen.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return '';
                          Severity: Major
                          Found in src/Admin/ReportListTable.php - About 30 mins to fix

                            Function getSmallScreenCell has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function getSmallScreenCell(IncidentReport $report, Parameters $parameters): string
                                {
                                    $content = '';
                                    $annotations = '';
                            
                            
                            Severity: Minor
                            Found in src/Frontend/ReportList/Renderer.php - About 25 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