atelierspierrot/library

View on GitHub

Showing 148 of 159 total issues

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

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

          public static function chmod(
              $path = null, $mode = self::DEFAULT_UNIX_CHMOD_DIRECTORIES,
              $recursive = true, $file_mode = self::DEFAULT_UNIX_CHMOD_FILES, array &$logs = array()
          ){
              if (is_null($path)) {
      Severity: Minor
      Found in src/Library/Helper/Directory.php - About 1 hr to fix

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

            public function renderTag($content, $tag_type = 'default', array $args = array())
            {
                switch($tag_type) {
        
                    // case of the tables ($content is an array of lines that are an array of cells)
        Severity: Minor
        Found in src/Library/Reporter/Adapter/Html.php - About 1 hr to fix

          Method getRequestUrl has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getRequestUrl($entities = false, $base = false, $no_file = false, $no_rewrite = false)
              {
                  $protocol = self::getHttpProtocol();
                  if ($no_rewrite) {
                      $url = $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
          Severity: Minor
          Found in src/Library/Helper/Url.php - About 1 hr to fix

            Method purge has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function purge($path = null, array &$logs = array())
                {
                    if (is_null($path)) {
                        return null;
                    }
            Severity: Minor
            Found in src/Library/Helper/Directory.php - About 1 hr to fix

              Function _repadAllLines has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function _repadAllLines()
                  {
                      $this->_parseTableSizes(true);
                      foreach (self::$_table_parts as $part) {
                          if (!empty($this->{$part}) && is_array($this->{$part})) {
              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

              Method create has 10 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $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: Major
              Found in src/Library/HttpFundamental/Request.php - About 1 hr to fix

                Function treatOptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function treatOptions(array $options, $caller)
                    {
                        if (!is_object($caller) || !($caller instanceof CommandLineControllerInterface)) {
                            throw new InvalidArgumentException(
                                sprintf('Argument 2 for method "%s::treatOptions" must be an object and implement the "CommandLineControllerInterface" interface!', __CLASS__)
                Severity: Minor
                Found in src/Library/CommandLine/Helper.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 _constructService has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _constructService($name, array $arguments = array())
                    {
                        if ($this->hasProvider($name)) {
                            $data = $this->getProvider($name);
                            if (is_object($data) && CodeHelper::implementsInterface($data, 'Library\ServiceContainer\ServiceProviderInterface')) {
                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 _overWriteOptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _overWriteOptions(array $options)
                    {
                        if (!empty($options)) {
                            foreach ($options as $name=>$stack) {
                                if (is_array($stack)) {
                Severity: Minor
                Found in src/Library/CommandLine/AbstractCommandLineController.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 handleEvent has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function handleEvent(EventInterface $event)
                    {
                        $return = null;
                        if (!is_null($this->callback)) {
                            try {
                Severity: Minor
                Found in src/Library/Event/EventObserverProxy.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 doConvert has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function doConvert(array $data, array $parent = array())
                    {
                        $output = '';
                        foreach ($data as $k => $v) {
                            $index = str_replace(' ', '-', $k);
                Severity: Minor
                Found in src/Library/Converter/Array2INI.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

                Severity
                Category
                Status
                Source
                Language