atelierspierrot/library

View on GitHub

Showing 148 of 159 total issues

Function remove has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public static function remove($path = null, array &$logs = array())
    {
        if (is_null($path)) {
            return null;
        }
Severity: Minor
Found in src/Library/Helper/Directory.php - About 3 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

Function __construct has a Cognitive Complexity of 23 (exceeds 5 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 3 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 getHelpInfo has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getHelpInfo(array $options = array(), Formater $formater, $caller)
    {
        if (!is_object($caller) || !($caller instanceof CommandLineControllerInterface)) {
            throw new InvalidArgumentException(
                sprintf('Argument 3 for method "%s::getHelpInfo" must be an object and implement the "CommandLineControllerInterface" interface!', __CLASS__)
Severity: Major
Found in src/Library/CommandLine/Helper.php - About 3 hrs to fix

    Response has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Response
        implements ResponseInterface
    {
    
        /**
    Severity: Minor
    Found in src/Library/HttpFundamental/Response.php - About 3 hrs to fix

      File Factory.php has 297 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/Factory.php - About 3 hrs to fix

        Function _parseTableSizes has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _parseTableSizes($reset = false)
            {
                if ($reset) $this->_resetSizes();
                $this->line_size = count($this->tbody);
                foreach (self::$_table_parts as $part) {
        Severity: Minor
        Found in src/Library/Tool/Table.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

        Function generateUrl has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
        Open

            public function generateUrl($route_infos, $base_uri = null, $hash = null, $separator = '&amp;')
            {
                $url_args = $this->getArgumentsMap()->getCollection();
        
                $url = $base_uri;
        Severity: Minor
        Found in src/Library/Router.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 organizeArguments has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function organizeArguments($method_name = null, $arguments = null, $class_name = null, &$logs = array())
            {
                if (empty($method_name)) {
                    return;
                }
        Severity: Major
        Found in src/Library/Helper/Code.php - About 2 hrs to fix

          Function __getMethods has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
          Open

              private function __getMethods($object)
              {
                  $reflection = new ReflectionClass($object);
                  
                  //get all methods
          Severity: Minor
          Found in src/Library/CodeParser.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 findBuilder has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function findBuilder($name, $flag = self::ERROR_ON_FAILURE, array &$logs = array())
              {
                  $this->flag($flag);
                  $cc_name = array(TextHelper::toCamelCase($name));
                  if (!$this->_findClasses($cc_name)) {
          Severity: Major
          Found in src/Library/Factory.php - About 2 hrs to fix

            Method build has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function build($name, array $parameters = null, $flag = self::ERROR_ON_FAILURE, array &$logs = array())
                {
                    $this->flag($flag);
                    $object = null;
                    $builder_class_name = $this->findBuilder($name, $flag, $logs);
            Severity: Major
            Found in src/Library/Factory.php - About 2 hrs to fix

              Pagination has 24 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class Pagination
                  implements \Iterator
              {
              
                  /**
              Severity: Minor
              Found in src/Library/Tool/Pagination.php - About 2 hrs to fix

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

                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

                  Session has 23 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Session
                      implements SessionInterface
                  {
                  
                      /**
                  Severity: Minor
                  Found in src/Library/Session/Session.php - About 2 hrs to fix

                    Router has 23 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class Router
                        implements RouterInterface
                    {
                    
                        /**
                    Severity: Minor
                    Found in src/Library/Router.php - About 2 hrs to fix

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

                          public function render($str_pad_flag = STR_PAD_RIGHT)
                          {
                              $stacks = array();
                              if ($this->column_size===0 && $this->line_size===0 && $this->cell_size===0) {
                                  $this->_parseTableSizes();
                      Severity: Major
                      Found in src/Library/Tool/Table.php - About 2 hrs to fix

                        Function init has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function init(
                                array $initial_services     = array(),
                                array $services_providers   = array(),
                                array $services_protected   = array()
                            ) {
                        Severity: Minor
                        Found in src/Library/ServiceContainer/ServiceContainer.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

                        Function __getReflection has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function __getReflection()
                            {
                                if (self::get_objectType() & self::PARSE_FUNC) {
                                    if (function_exists(self::get_objectName()))
                                        $this->reflection = new ReflectionFunction( self::get_objectName() ); 
                        Severity: Minor
                        Found in src/Library/CodeParser.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

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

                        Severity
                        Category
                        Status
                        Source
                        Language