atelierspierrot/library

View on GitHub

Showing 159 of 159 total issues

Method __construct has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct(array $options = array())
    {
//        if (!isset($this->options)) $this->options = array();
        $this
            ->_initOptions()
Severity: Minor
Found in src/Library/CommandLine/AbstractCommandLineController.php - About 1 hr to fix

    Method format has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function format($text = null, $foreground = null, $background = null, $option = null)
        {
            $codes = array();
    
            if (!empty($foreground)) {
    Severity: Minor
    Found in src/Library/CommandLine/Formater.php - About 1 hr to fix

      Method dumpClosure has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function dumpClosure(\Closure $c)
          {
              $str = 'function (';
              $r = new \ReflectionFunction($c);
              $params = array();
      Severity: Minor
      Found in src/Library/Helper/Code.php - About 1 hr to fix

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

            protected function _setPartLine(array $contents, $line_index, $part, $action = 'replace')
            {
                if (property_exists($this, $part)) {
                    if (is_null($line_index)) {
                        end($this->{$part});
        Severity: Minor
        Found in src/Library/Tool/Table.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 _invokeReset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _invokeReset($name)
            {
                if (!self::__isInvokable($name)) {
                    return $this;
                }
        Severity: Minor
        Found in src/Library/Object/AbstractInvokable.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 usage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public function usage($opt = null)
            {
                if (!empty($opt)) {
                    if (!is_array($opt)) $opt = array( $opt=>'' );
                    $opt_keys = array_keys($opt);
        Severity: Minor
        Found in src/Library/CommandLine/AbstractCommandLineController.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 parseSingleCondition has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function parseSingleCondition($condition)
            {
                $add_ie = strpos($condition, self::$internet_explorer)===false;
                foreach (self::$condition_shortcuts as $key=>$val) {
                    if (strpos($condition, $key)!==false) {
        Severity: Minor
        Found in src/Library/Helper/ConditionalComment.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 buildCondition has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function buildCondition($content, $condition = 'if IE', $operator = 'OR', $global = false)
            {
                if (empty($condition)) {
                    return $content;
                }
        Severity: Minor
        Found in src/Library/Helper/ConditionalComment.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 _doTable has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _doTable(&$content, array &$args = array())
            {
                $table = new TableTool(
                    isset($content['body']) && is_array($content['body']) ? $content['body'] : array($content),
                    isset($content['head']) && is_array($content['head']) ? $content['head'] : array(),
        Severity: Minor
        Found in src/Library/Reporter/Adapter/Html.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

        Method addCache has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function addCache($command, $result, $error, $status = 0, $cwd = null, $env = null, $options = null)
        Severity: Major
        Found in src/Library/Command.php - About 50 mins 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 findPropertyNameStatic has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function findPropertyNameStatic($name, $object)
              {
                  $property = null;
                  if (property_exists($object, $name)) {
                      $property = $name;
          Severity: Minor
          Found in src/Library/Object/AbstractInvokable.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 triggerEvent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function triggerEvent($event_name, ObservableInterface $subject)
              {
                  if (is_null($event_name)) {
                      return $this;
                  }
          Severity: Minor
          Found in src/Library/Event/EventManager.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 getallheaders has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getallheaders()
              {
                  if (function_exists('getallheaders')) {
                      $return = getallheaders();
                  } else {
          Severity: Minor
          Found in src/Library/HttpFundamental/Request.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 _addNamespaces has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function _addNamespaces($names, array $namespaces, array &$logs = array())
              {
                  if (!is_array($names)) {
                      $names = array($names);
                  }
          Severity: Minor
          Found in src/Library/Factory.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 write has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function write($file_path = null, $content, $type = 'a', $force = false, array &$logs = array())
              {
                  if (is_null($file_path)) {
                      return null;
                  }
          Severity: Minor
          Found in src/Library/Helper/File.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 getLuhnKey has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getLuhnKey($val = null)
              {
                  if (is_null($val)) {
                      return null;
                  }
          Severity: Minor
          Found in src/Library/Helper/Number.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 getNewId has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getNewId($reference = null, $base_id = null)
              {
                  if (empty($reference)) {
                      $reference = uniqid();
                  }
          Severity: Minor
          Found in src/Library/Helper/Html.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 create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function create(
                  $url = null, $flag = self::NO_REWRITE,
                  $protocol = 'http', $method = 'get', array $headers = null, 
                  array $arguments = null, array $data = null, 
                  array $session = null, array $files = null, array $cookies = null
          Severity: Minor
          Found in src/Library/HttpFundamental/Request.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 write has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function write($content = '')
              {
                  if ($this->rotate()) {
                      if (empty($this->file_mtime) && file_exists($this->file_path)) {
                          $this->file_mtime = filemtime($this->file_path);
          Severity: Minor
          Found in src/Library/Tool/FileRotator.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

          Severity
          Category
          Status
          Source
          Language