atelierspierrot/library

View on GitHub
src/Library/HttpFundamental/Cookie.php

Summary

Maintainability
C
1 day
Test Coverage

Cookie has 37 functions (exceeds 20 allowed). Consider refactoring.
Open

class Cookie
{
    
    /**
     * Transform array values as flatten string (`serialize` like)
Severity: Minor
Found in src/Library/HttpFundamental/Cookie.php - About 4 hrs to fix

    File Cookie.php has 272 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * This file is part of the Library package.
     *
     * Copyleft (ↄ) 2013-2016 Pierre Cassat <me@e-piwi.fr> and contributors
    Severity: Minor
    Found in src/Library/HttpFundamental/Cookie.php - About 2 hrs to fix

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

          public function send($cookie_name = null, $cookie_value = null)
          {
              if (!empty($cookie_name)) {
                  $this->setName($cookie_name);
              }
      Severity: Minor
      Found in src/Library/HttpFundamental/Cookie.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

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

          protected function _organizeCookieFuncArguments()
          {
              $original_args = $this->_arguments;
              $this->_arguments = array();
              $missing_var = $missing_index = null;
      Severity: Minor
      Found in src/Library/HttpFundamental/Cookie.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

      There are no issues that match your filters.

      Category
      Status