thinreports-php/thinreports-php

View on GitHub

Showing 30 of 30 total issues

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

    public function drawRect($x, $y, $width, $height, array $attrs = array())
Severity: Minor
Found in src/Thinreports/Generator/PDF/Graphics.php - About 35 mins to fix

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

        public function drawLine($x1, $y1, $x2, $y2, array $attrs = array())
    Severity: Minor
    Found in src/Thinreports/Generator/PDF/Graphics.php - About 35 mins to fix

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

          public function drawEllipse($cx, $cy, $rx, $ry, array $attrs = array())
      Severity: Minor
      Found in src/Thinreports/Generator/PDF/Graphics.php - About 35 mins to fix

        Avoid too many return statements within this method.
        Open

                        return true;
        Severity: Major
        Found in src/Thinreports/Generator/Renderer/ItemRenderer.php - About 30 mins to fix

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

              public function parse(Layout $layout)
              {
                  $svg = preg_replace('<%.+?%>', '', $layout->getSVG());
          
                  $xml = new \SimpleXMLElement($svg);
          Severity: Minor
          Found in src/Thinreports/Generator/Renderer/LayoutRenderer.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 getBounds has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getBounds()
              {
                  $svg_attrs = $this->getSVGAttributes();
          
                  switch (true) {
          Severity: Minor
          Found in src/Thinreports/Item/BasicItem.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 renderBasicItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function renderBasicItem(Item\BasicItem $item)
              {
                  switch (true) {
                      case $item->isImage():
                          $this->renderImageItem($item);
          Severity: Minor
          Found in src/Thinreports/Generator/Renderer/ItemRenderer.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 extractItemFormats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              static public function extractItemFormats($layout_format)
              {
                  preg_match_all('/<!--SHAPE(.*?)SHAPE-->/',
                      $layout_format, $matched_items, PREG_SET_ORDER);
          
          
          Severity: Minor
          Found in src/Thinreports/Layout.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 createItem has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function createItem(Page $owner, $id)
              {
                  if (!$this->hasItem($id)) {
                      throw new Exception\StandardException('Item Not Found', $id);
                  }
          Severity: Minor
          Found in src/Thinreports/Layout.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 render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render(Item\AbstractItem $item)
              {
                  if (!$this->isRenderable($item)) {
                      return;
                  }
          Severity: Minor
          Found in src/Thinreports/Generator/Renderer/ItemRenderer.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