phpmyadmin/phpmyadmin

View on GitHub
src/Gis/GisVisualization.php

Summary

Maintainability
D
1 day
Test Coverage

File GisVisualization.php has 314 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * Handles visualization of GIS data
 */

Severity: Minor
Found in src/Gis/GisVisualization.php - About 3 hrs to fix

    GisVisualization has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class GisVisualization
    {
        /** Array of colors to be used for GIS visualizations.*/
        private const COLORS = [
            [176, 46, 224],
    Severity: Minor
    Found in src/Gis/GisVisualization.php - About 2 hrs to fix

      Function prepareDataSet has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          private function prepareDataSet(
              array $data,
              string $format,
              ImageWrapper|TCPDF|null $renderer = null,
          ): array|string|null {
      Severity: Minor
      Found in src/Gis/GisVisualization.php - 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

      Method modifySqlQuery has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function modifySqlQuery(string $sqlQuery): string
          {
              $modifiedQuery = 'SELECT ';
              $spatialAsText = 'ASTEXT';
              $spatialSrid = 'SRID';
      Severity: Minor
      Found in src/Gis/GisVisualization.php - About 1 hr to fix

        Method prepareDataSet has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function prepareDataSet(
                array $data,
                string $format,
                ImageWrapper|TCPDF|null $renderer = null,
            ): array|string|null {
        Severity: Minor
        Found in src/Gis/GisVisualization.php - About 1 hr to fix

          Method scaleDataSet has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function scaleDataSet(array $data): ScaleData|null
              {
                  $extent = Extent::empty();
          
                  foreach ($data as $row) {
          Severity: Minor
          Found in src/Gis/GisVisualization.php - About 1 hr to fix

            Function scaleDataSet has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function scaleDataSet(array $data): ScaleData|null
                {
                    $extent = Extent::empty();
            
                    foreach ($data as $row) {
            Severity: Minor
            Found in src/Gis/GisVisualization.php - About 55 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

            There are no issues that match your filters.

            Category
            Status