PronerInformatica/phppimaco

View on GitHub

Showing 34 of 34 total issues

Method render has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function render()
    {
        if ($this->br === null) {
            if ($this->align == 'left') {
                $styles[] = "float: left";
Severity: Major
Found in src/Tags/Barcode.php - About 3 hrs to fix

    Method render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function render()
        {
            $qrcode = new \Endroid\QrCode\QrCode();
            $qrcode->setErrorCorrectionLevel(ErrorCorrectionLevel::HIGH);
            $qrcode->setEncoding('UTF-8');
    Severity: Minor
    Found in src/Tags/QrCode.php - About 1 hr to fix

      Method render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render($side = null, $margin = false)
          {
              $this->content = "";
      
              if (!empty($side)) {
      Severity: Minor
      Found in src/Tag.php - About 1 hr to fix

        Function render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            public function render()
            {
                $qrcode = new \Endroid\QrCode\QrCode();
                $qrcode->setErrorCorrectionLevel(ErrorCorrectionLevel::HIGH);
                $qrcode->setEncoding('UTF-8');
        Severity: Minor
        Found in src/Tags/QrCode.php - About 1 hr 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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function render($side = null, $margin = false)
            {
                $this->content = "";
        
                if (!empty($side)) {
        Severity: Minor
        Found in src/Tag.php - About 1 hr 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public function render()
            {
                $this->content = "";
        
                $rows = ceil($this->tags->count()/$this->columns);
        Severity: Minor
        Found in src/Pimaco.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

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

            public function render()
            {
                if ($this->width !== null) {
                    $styles[] = "width: {$this->width}mm";
                }
        Severity: Minor
        Found in src/Tags/Img.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

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

            public function render()
            {
                if ($this->br === null) {
                    if ($this->align == 'left') {
                        $styles[] = "float: left";
        Severity: Minor
        Found in src/Tags/Barcode.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

        Avoid too many return statements within this method.
        Open

                        return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_EAN_5, $this->width, $this->height))."'>".$this->br;
        Severity: Major
        Found in src/Tags/Barcode.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_EAN_8, $this->width, $this->height))."'>".$this->br;
          Severity: Major
          Found in src/Tags/Barcode.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_MSI, $this->width, $this->height))."'>".$this->br;
            Severity: Major
            Found in src/Tags/Barcode.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_CODE_128_B, $this->width, $this->height))."'>".$this->br;
              Severity: Major
              Found in src/Tags/Barcode.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_PHARMA_CODE, $this->width, $this->height))."'>".$this->br;
                Severity: Major
                Found in src/Tags/Barcode.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_MSI_CHECKSUM, $this->width, $this->height))."'>".$this->br;
                  Severity: Major
                  Found in src/Tags/Barcode.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_CODE_11, $this->width, $this->height))."'>".$this->br;
                    Severity: Major
                    Found in src/Tags/Barcode.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_PHARMA_CODE_TWO_TRACKS, $this->width, $this->height))."'>".$this->br;
                      Severity: Major
                      Found in src/Tags/Barcode.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_CODE_128_C, $this->width, $this->height))."'>".$this->br;
                        Severity: Major
                        Found in src/Tags/Barcode.php - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                          return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_IMB, $this->width, $this->height))."'>".$this->br;
                          Severity: Major
                          Found in src/Tags/Barcode.php - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                            return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_RMS4CC, $this->width, $this->height))."'>".$this->br;
                            Severity: Major
                            Found in src/Tags/Barcode.php - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                              return "<img ".$style." src='data:image/png;base64,".base64_encode($barcode->getBarcode($this->content, $barcode::TYPE_STANDARD_2_5_CHECKSUM, $this->width, $this->height))."'>".$this->br;
                              Severity: Major
                              Found in src/Tags/Barcode.php - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language