spotonlive/sl-laravel-zf2-form

View on GitHub

Showing 7 of 7 total issues

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

    public function render(ElementInterface $element, $labelPosition = null)
    {
        $escapeHtmlHelper    = $this->getEscapeHtmlHelper();
        $labelHelper         = $this->getLabelHelper();
        $elementHelper       = $this->getElementHelper();
Severity: Minor
Found in src/SpotOnLive/LaravelZf2Form/View/Helper/FormRow.php - About 6 hrs 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

FormHelper has 39 functions (exceeds 20 allowed). Consider refactoring.
Open

class FormHelper
{
    /**
     * Open tag
     *
Severity: Minor
Found in src/SpotOnLive/LaravelZf2Form/Helpers/FormHelper.php - About 5 hrs to fix

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

        public function render(ElementInterface $element, $labelPosition = null)
        {
            $escapeHtmlHelper    = $this->getEscapeHtmlHelper();
            $labelHelper         = $this->getLabelHelper();
            $elementHelper       = $this->getElementHelper();
    Severity: Major
    Found in src/SpotOnLive/LaravelZf2Form/View/Helper/FormRow.php - About 3 hrs to fix

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

          public function render(ElementInterface $element)
          {
              $markup           = '';
              $templateMarkup   = '';
              $fieldsetHelper   = $this->getFieldsetHelper();
      Severity: Minor
      Found in src/SpotOnLive/LaravelZf2Form/View/Helper/FormCollection.php - About 2 hrs 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 render has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function render(ElementInterface $element)
          {
              $markup           = '';
              $templateMarkup   = '';
              $fieldsetHelper   = $this->getFieldsetHelper();
      Severity: Minor
      Found in src/SpotOnLive/LaravelZf2Form/View/Helper/FormCollection.php - About 1 hr to fix

        Method row has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function row(ElementInterface $element = null, $labelPosition = null, $renderErrors = null, $partial = null)
            {
                $helper = new \SpotOnLive\LaravelZf2Form\View\Helper\FormRow();
                return $helper->__invoke($element, $labelPosition, $renderErrors, $partial);
        
        
        Severity: Minor
        Found in src/SpotOnLive/LaravelZf2Form/Helpers/FormHelper.php - About 1 hr to fix

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

              public function row(ElementInterface $element = null, $labelPosition = null, $renderErrors = null, $partial = null)
              {
                  $helper = new \SpotOnLive\LaravelZf2Form\View\Helper\FormRow();
                  return $helper->__invoke($element, $labelPosition, $renderErrors, $partial);
          
          
          Severity: Minor
          Found in src/SpotOnLive/LaravelZf2Form/Helpers/FormHelper.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

          Severity
          Category
          Status
          Source
          Language