younishd/endobox

View on GitHub

Showing 8 of 8 total issues

Box has 21 functions (exceeds 20 allowed). Consider refactoring.
Open

class Box implements Renderable, \IteratorAggregate
{

    use LinkedList;

Severity: Minor
Found in src/endobox/renderable/Box.php - About 2 hrs to fix

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

        public function render(Box $box, array $shared = null) : string
        {
            $code = parent::render($box, $shared);
    
            $context = $box->getContext();
    Severity: Minor
    Found in src/endobox/renderer/decorator/EvalRendererDecorator.php - About 1 hr to fix

      Method create has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function create(string $template) : Box
          {
              foreach ($this->paths as $path) {
                  $file = \rtrim($path, '/') . '/' . \trim($template, '/');
      
      
      Severity: Minor
      Found in src/endobox/factory/BoxFactory.php - About 1 hr to fix

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

            private function renderAll() : string
            {
                $result = '';
                $shared = [];
        
        
        Severity: Minor
        Found in src/endobox/renderable/Box.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 create has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public function create(string $template) : Box
            {
                foreach ($this->paths as $path) {
                    $file = \rtrim($path, '/') . '/' . \trim($template, '/');
        
        
        Severity: Minor
        Found in src/endobox/factory/BoxFactory.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(Box $box, array $shared = null) : string
            {
                $code = parent::render($box, $shared);
        
                $context = $box->getContext();
        Severity: Minor
        Found in src/endobox/renderer/decorator/EvalRendererDecorator.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 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function render(array $data = null) : string
            {
                try {
        
                    // mark as render root unless already set
        Severity: Minor
        Found in src/endobox/renderable/Box.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 union has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            private function union(Box $box)
            {
                $root1 = $this->find();
                $root2 = $box->find();
        
        
        Severity: Minor
        Found in src/endobox/structure/UnionFind.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