werneckbh/qr-code

View on GitHub
src/QR_Code/Encoder/Vector.php

Summary

Maintainability
C
7 hrs
Test Coverage

Method vectEPS has 51 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static function vectEPS ($frame, int $pixelPerPoint = 4, int $outerFrame = 4, int $backColor = 0xFFFFFF, int $foreColor = 0x000000, bool $cmyk = false) : string
    {
        $h = count($frame);
        $w = strlen($frame[0]);
Severity: Major
Found in src/QR_Code/Encoder/Vector.php - About 2 hrs to fix

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

        private static function vectSVG ($frame, int $pixelPerPoint = 4, int $outerFrame = 4, int $backColor = 0xFFFFFF, int $foreColor = 0x000000) : string
        {
            $h = count($frame);
            $w = strlen($frame[0]);
    
    Severity: Minor
    Found in src/QR_Code/Encoder/Vector.php - About 1 hr to fix

      Method eps has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function eps ($frame, $filename = false, int $pixelPerPoint = 4, int $outerFrame = 4, bool $saveAndPrint = false, int $backColor = 0xFFFFFF, int $foreColor = 0x000000, bool $cmyk = false) : void
      Severity: Major
      Found in src/QR_Code/Encoder/Vector.php - About 1 hr to fix

        Method svg has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function svg ($frame, $filename = false, int $pixelPerPoint = 4, int $outerFrame = 4, bool $saveAndPrint = false, int $backColor, int $foreColor) : void
        Severity: Major
        Found in src/QR_Code/Encoder/Vector.php - About 50 mins to fix

          Method vectEPS has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private static function vectEPS ($frame, int $pixelPerPoint = 4, int $outerFrame = 4, int $backColor = 0xFFFFFF, int $foreColor = 0x000000, bool $cmyk = false) : string
          Severity: Minor
          Found in src/QR_Code/Encoder/Vector.php - About 45 mins to fix

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

                private static function vectEPS ($frame, int $pixelPerPoint = 4, int $outerFrame = 4, int $backColor = 0xFFFFFF, int $foreColor = 0x000000, bool $cmyk = false) : string
                {
                    $h = count($frame);
                    $w = strlen($frame[0]);
            
            Severity: Minor
            Found in src/QR_Code/Encoder/Vector.php - 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

            Method vectSVG has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                private static function vectSVG ($frame, int $pixelPerPoint = 4, int $outerFrame = 4, int $backColor = 0xFFFFFF, int $foreColor = 0x000000) : string
            Severity: Minor
            Found in src/QR_Code/Encoder/Vector.php - About 35 mins to fix

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

                  private static function vectSVG ($frame, int $pixelPerPoint = 4, int $outerFrame = 4, int $backColor = 0xFFFFFF, int $foreColor = 0x000000) : string
                  {
                      $h = count($frame);
                      $w = strlen($frame[0]);
              
              Severity: Minor
              Found in src/QR_Code/Encoder/Vector.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

              There are no issues that match your filters.

              Category
              Status