PronerInformatica/phppimaco

View on GitHub
src/Tags/Barcode.php

Summary

Maintainability
D
2 days
Test Coverage

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

    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_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_STANDARD_2_5_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_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_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_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_UPC_A, $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_2, $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_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_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_CODE_128, $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_POSTNET, $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_CODABAR, $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_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_STANDARD_2_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_PLANET, $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_INTERLEAVED_2_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_13, $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_93, $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_INTERLEAVED_2_5_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_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_CODE_128_A, $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_UPC_E, $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_KIX, $this->width, $this->height))."'>".$this->br;
                                                      Severity: Major
                                                      Found in src/Tags/Barcode.php - About 30 mins to fix

                                                        There are no issues that match your filters.

                                                        Category
                                                        Status