abrain/einsatzverwaltung

View on GitHub

Showing 151 of 250 total issues

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

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

    public function getColumnContent($columnId, IncidentReport $report): string
    {
        switch ($columnId) {
            case 'e_nummer':
                $numberString = $report->getNumber();
Severity: Minor
Found in src/Admin/ReportListTable.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

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

    public function add(CustomType $customType, CustomField $customField)
    {
        if ($customType instanceof CustomTaxonomy) {
            $taxonomy = $customType::getSlug();

Severity: Minor
Found in src/CustomFieldsRepository.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

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

    public function checkPreconditions()
    {
        $this->fileHasHeadlines = (bool) Utilities::getArrayValueIfKey($this->args, 'has_headlines', false);

        $delimiter = Utilities::getArrayValueIfKey($this->args, 'delimiter', false);
Severity: Minor
Found in src/Import/Sources/Csv.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

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

    public function renderPage()
    {
        echo '<div class="wrap">';
        echo '<h1>Einsatzverwaltung</h1>';

Severity: Minor
Found in src/Admin/TasksPage.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

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

    protected function getQuery(): WP_Query
    {
        // Wähle nur veröffentlichte Einsatzberichte aus
        $args = array(
            'post_type' => 'einsatz',
Severity: Minor
Found in src/Export/Formats/AbstractFormat.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

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

    public static function compareVehicles(WP_Term $vehicle1, WP_Term $vehicle2): int
    {
        $order1 = get_term_meta($vehicle1->term_id, 'vehicleorder', true);
        $order2 = get_term_meta($vehicle2->term_id, 'vehicleorder', true);

Severity: Minor
Found in src/Types/Vehicle.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

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

    public function addBadgeToMenu()
    {
        global $submenu;
        $termsWithParentCount = $this->getTermsWithParentCount();
        if ($termsWithParentCount > 0) {
Severity: Minor
Found in src/Types/Vehicle.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

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

    public static function groupVehiclesByUnit(array $vehicles): array
    {
        // Get and sort the units
        $units = get_terms(['taxonomy' => Unit::getSlug(), 'hide_empty' => false]);
        usort($units, array(Unit::class, 'compare'));
Severity: Minor
Found in src/Utilities.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

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

    public function onPublish(int $postId, WP_Post $post)
    {
        $report = new IncidentReport($post);

        // Laufende Nummern aktualisieren
Severity: Minor
Found in src/Data.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

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

    public static function compare(WP_Term $unit1, WP_Term $unit2): int
    {
        $order1 = get_term_meta($unit1->term_id, 'unit_order', true);
        $order2 = get_term_meta($unit2->term_id, 'unit_order', true);

Severity: Minor
Found in src/Types/Unit.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