atelierspierrot/library

View on GitHub

Showing 148 of 159 total issues

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

    protected function _setPartCell($content, $line_index, $cell_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 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 getTableIterator has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTableIterator($part = 'body', $iterator_flag = self::ITERATE_ON_LINES)
    {
        $this->_repadAllLines();
        $table = $this->getTable();
        unset($table['title']);
Severity: Minor
Found in src/Library/Tool/Table.php - About 1 hr to fix

    Function copy has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function copy($file_path = null, $target_path = null, $force = false, array &$logs = array())
        {
            if (is_null($file_path) || is_null($target_path)) {
                return null;
            }
    Severity: Minor
    Found in src/Library/Helper/File.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 load has a Cognitive Complexity of 15 (exceeds 5 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

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

        public static function url($param = null, $value = null, $url = null)
        {
            if (is_null($param)) {
                return '';
            }
    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 intToRoman has a Cognitive Complexity of 15 (exceeds 5 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

    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 _treatOptions has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _treatOptions()
        {
            $this->params = self::getopt();
            $this->debugWrite( ">> Command line arguments are [".var_export($this->params,1)."]" );
    
    
    Severity: Minor
    Found in src/Library/CommandLine/AbstractCommandLineController.php - About 1 hr to fix

      Method formatHelpString has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function formatHelpString($title = null, $contents = null, Formater $formater)
          {
              if (empty($contents)) return '';
              if (empty($title)) $title = 'Help';
              if (!is_array($contents)) $contents = array( $contents );
      Severity: Minor
      Found in src/Library/CommandLine/Helper.php - About 1 hr to fix

        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 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

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

            private function __extractDocString($DocComment, $lines = null, $parse_tags = false)
            {
                $split = preg_split("/\r\n|\n|\r/", $DocComment);
        
                //clean up: removes useless chars like new-lines, tabs and *
        Severity: Minor
        Found in src/Library/CodeParser.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

        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 _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 _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 _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 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 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

            Severity
            Category
            Status
            Source
            Language