atelierspierrot/library

View on GitHub

Showing 159 of 159 total issues

Consider simplifying this complex logical expression.
Open

        if (
            !is_object($callback) && !is_callable($callback) && !(
                is_array($callback) &&
                count($callback)==2 &&
                is_object($callback[0]) &&
Severity: Major
Found in src/Library/Event/EventObserverProxy.php - About 40 mins to fix

    Method write has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static function write($file_path = null, $content, $type = 'a', $force = false, array &$logs = array())
    Severity: Minor
    Found in src/Library/Helper/File.php - About 35 mins to fix

      Method chmod has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $path = null, $mode = self::DEFAULT_UNIX_CHMOD_DIRECTORIES,
              $recursive = true, $file_mode = self::DEFAULT_UNIX_CHMOD_FILES, array &$logs = array()
      Severity: Minor
      Found in src/Library/Helper/Directory.php - About 35 mins to fix

        Method getData has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function getData($param = null, $default = false, $clean = true, $clean_flags = ENT_COMPAT, $clean_encoding = 'UTF-8')
        Severity: Minor
        Found in src/Library/HttpFundamental/Request.php - About 35 mins to fix

          Method _setPartColumn has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected function _setPartColumn(array $contents, $column_index, $default, $part, $action = 'replace')
          Severity: Minor
          Found in src/Library/Tool/Table.php - About 35 mins to fix

            Method renderMulti has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function renderMulti($content, $tag_type = 'default', array $multi = array(), $args = null, $placeholder_mask = '@%s@')
            Severity: Minor
            Found in src/Library/Reporter/Reporter.php - About 35 mins to fix

              Method getArgument has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function getArgument($param = null, $default = false, $clean = true, $clean_flags = ENT_COMPAT, $clean_encoding = 'UTF-8') 
              Severity: Minor
              Found in src/Library/HttpFundamental/Request.php - About 35 mins to fix

                Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        array $body = array(), array $header = array(), array $footer = array(),
                        $title = null, $pad_flag = self::PAD_BY_EMPTY_CELLS
                Severity: Minor
                Found in src/Library/Tool/Table.php - About 35 mins to fix

                  Method _setPartCell has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      protected function _setPartCell($content, $line_index, $cell_index, $part, $action = 'replace')
                  Severity: Minor
                  Found in src/Library/Tool/Table.php - About 35 mins to fix

                    Function _getPartColumn has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function _getPartColumn($column_index, $part)
                        {
                            if (property_exists($this, $part)) {
                                if (is_null($column_index)) {
                                    $column_index = $this->getColumnSize();
                    Severity: Minor
                    Found in src/Library/Tool/Table.php - About 35 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 isUrl has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function isUrl($url = null, $protocols = array('http','https','ftp'), $localhost = false)
                        { 
                            if (is_null($url) || !$url || !is_string($url)) {
                                return false;
                            }
                    Severity: Minor
                    Found in src/Library/Helper/Url.php - About 35 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 loadClass has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function loadClass($className)
                        {
                            if ($filePath = $this->resolveFileName($className)) {
                                if ($this->getFailureFlag() & self::FAIL_GRACEFULLY) {
                                    if ($this->classFileExists($filePath)) {
                    Severity: Minor
                    Found in src/SplClassLoader.php - About 35 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 getOptionHelp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

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

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

                        protected function _organizeCookieFuncArguments()
                        {
                            $original_args = $this->_arguments;
                            $this->_arguments = array();
                            $missing_var = $missing_index = null;
                    Severity: Minor
                    Found in src/Library/HttpFundamental/Cookie.php - About 35 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 prepareContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function prepareContent($content)
                        {
                            if (is_array($content)) {
                                $ctt = '';
                                foreach ($content as $key=>$ctt) {
                    Severity: Minor
                    Found in src/Library/HttpFundamental/ContentType/PlainText.php - About 35 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 isCached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function isCached($command, $cwd = null)
                        {
                            foreach ($this->cache as $i=>$cache) {
                                if ($cache['command']===$command) {
                                    if (is_null($cwd)) {
                    Severity: Minor
                    Found in src/Library/Command.php - About 35 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 getOptionDescription has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

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

                        protected function init(array $user_options=array(), $logname = null)
                        {
                            $this->logname = $logname;
                            if (true===self::$isInited) return;
                            foreach (self::$config as $_static=>$_value) {
                    Severity: Minor
                    Found in src/Library/Logger.php - About 35 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 romanToInt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function romanToInt($str = null)
                        {
                            if (is_null($str)) {
                                return null;
                            }
                    Severity: Minor
                    Found in src/Library/Helper/RomanNumber.php - About 35 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