atelierspierrot/library

View on GitHub

Showing 159 of 159 total issues

Function rotate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function rotate($force = false)
    {
        $rotator = $this->options['backup_time'];

        if (true===$force || $this->mustRotate()) {
Severity: Minor
Found in src/Library/Tool/FileRotator.php - About 1 hr 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 getParameter has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getParameter($param = false, $url = false)
    {
        if (empty($param)) {
            return null;
        }
Severity: Minor
Found in src/Library/Helper/Url.php - About 1 hr 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 _getArgsStackForTable has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _getArgsStackForTable(array &$args, $entry, $scope)
    {
        $found_args = array();
        $global_args = $this->_getArgsStack($args, $entry, array(), false);
        if (!empty($global_args)) {
Severity: Minor
Found in src/Library/Reporter/Adapter/Html.php - About 1 hr 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 buildUrl has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildUrl()
    {
        $url = UrlHelper::parse($this->getUrl());
        
        $get = $this->getArguments();
Severity: Minor
Found in src/Library/HttpFundamental/Request.php - About 1 hr 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 namespaceExists has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function namespaceExists($namespace)
    {
        $namespace = trim($namespace, self::NAMESPACE_SEPARATOR);
        $namespace .= self::NAMESPACE_SEPARATOR;

Severity: Minor
Found in src/Library/Helper/Code.php - About 1 hr to fix

    Method parse has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function parse($node)
        {
            $output = array();
            switch ($node->nodeType) {
                case XML_CDATA_SECTION_NODE:
    Severity: Minor
    Found in src/Library/Converter/Xml2Array.php - About 1 hr to fix

      Function format has a Cognitive Complexity of 13 (exceeds 5 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

      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 _setPartColumn has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _setPartColumn(array $contents, $column_index, $default, $part, $action = 'replace')
          {
              if (property_exists($this, $part)) {
                  if (is_null($column_index) || $column_index>$this->getColumnSize()) {
                      $column_index = $this->getColumnSize();
      Severity: Minor
      Found in src/Library/Tool/Table.php - About 1 hr 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 _extractSegments has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _extractSegments(&$arguments)
          {
              if (is_string($arguments)) $this->_extractArguments($arguments);
              foreach ($arguments as $var=>$val) {
                  if (empty($val) && strpos($var, '/')!==false) {
      Severity: Minor
      Found in src/Library/HttpFundamental/Request.php - About 1 hr 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 _classesImplements has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _classesImplements($names, array $interfaces, $must_implement_all = false, array &$logs = array())
          {
              if (!is_array($names)) {
                  $names = array($names);
              }
      Severity: Minor
      Found in src/Library/Factory.php - About 1 hr 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 interpolate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function interpolate($message, array $context = array(), $silent = false)
          {
              $replace = array();
              foreach ($context as $key => $val) {
                  if ($key==='exception' && ($val instanceof \Exception)) {
      Severity: Minor
      Found in src/Library/Logger.php - About 1 hr 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 unsetService has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function unsetService($name)
          {
              if ($this->hasService($name)) {
                  if (!$this->isProtected($name)) {
                      if ($this->hasProvider($name)) {
      Severity: Minor
      Found in src/Library/ServiceContainer/ServiceContainer.php - About 1 hr 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 __call has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __call($name, array $arguments)
          {
              $return = null;
      
              // unset, isset, reset
      Severity: Minor
      Found in src/Library/Object/AbstractInvokable.php - About 1 hr 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 dumpClosure has a Cognitive Complexity of 12 (exceeds 5 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

      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 __call has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __call($name, array $arguments)
          {
              $return = null;
              
              // unset, isset, reset
      Severity: Minor
      Found in src/Library/Object/RegistryInvokable.php - About 1 hr 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 _classesExtends has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _classesExtends($names, array $classes, array &$logs = array())
          {
              if (!is_array($names)) {
                  $names = array($names);
              }
      Severity: Minor
      Found in src/Library/Factory.php - About 1 hr 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 _getPartCell has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _getPartCell($line_index, $cell_index, $part)
          {
              if (property_exists($this, $part)) {
                  if (is_null($line_index)) {
                      $line_index = $this->getLineSize();
      Severity: Minor
      Found in src/Library/Tool/Table.php - About 1 hr 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 _classesInNamespaces has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function _classesInNamespaces($names, array $namespaces, array &$logs = array())
          {
              if (!is_array($names)) {
                  $names = array($names);
              }
      Severity: Minor
      Found in src/Library/Factory.php - About 1 hr 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 intToRoman has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function intToRoman($a = null)
          {
              if (is_null($a)) {
                  return null;
              }
      Severity: Minor
      Found in src/Library/Helper/RomanNumber.php - About 1 hr to fix

        Method load has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function load($class_name = null)
            {
                if (empty(self::$__registry) && empty(self::$__configurator) && empty($class_name)) {
                    $class_name = self::getInternal('config-class');
                    if (empty($class_name)) {
        Severity: Minor
        Found in src/Library/StaticConfiguration/Config.php - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language