shieldfy/shieldfy-php-client

View on GitHub

Showing 39 of 47 total issues

Function getBaseDirectory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function getBaseDirectory()
    {

        // -- first method --
        //
Severity: Minor
Found in src/Config.php - About 45 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

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

    public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
Severity: Minor
Found in src/Collectors/PDO/TraceablePDOStatement.php - About 35 mins to fix

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

        public function bindParam($parameter, &$variable, $data_type = PDO::PARAM_STR, $length = null, $driver_options = null)
    Severity: Minor
    Found in src/Collectors/PDO/TraceablePDOStatement.php - About 35 mins to fix

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

          public function __construct(Config $config, Session $session, Dispatcher $dispatcher, array $collectors, Events $events)
      Severity: Minor
      Found in src/Monitors/MonitorsBag.php - About 35 mins to fix

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

            public function __construct(Config $config, Session $session, Dispatcher $dispatcher, array $collectors, Events $events)
        Severity: Minor
        Found in src/Monitors/MonitorBase.php - About 35 mins to fix

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

              public function __construct($get = [], $post = [], $server = [], $cookies = [], $files = [])
          Severity: Minor
          Found in src/Collectors/RequestCollector.php - About 35 mins to fix

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

                protected function logInternalError($exception)
                {
                    if (!is_writable($this->config['logsDir'])) {
                        return;
                    }
            Severity: Minor
            Found in src/Collectors/ExceptionsCollector.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 save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private function save(array $data = [])
                {
                    // If not writable, try to chmod it.
                    if (!is_writable($this->config['paths']['data'])) {
                        @chmod($this->config['paths']['data'], 0755);
            Severity: Minor
            Found in src/Callbacks/UpdateCallback.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 runContain has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private function runContain($value)
                {
            
                    // Multiple contain.
                    if (strpos($this->data['rule'], '|') !== false) {
            Severity: Minor
            Found in src/Jury/Rule.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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function execute($input_parameters = null)
                {
                    $preparedId = spl_object_hash($this);
                    $boundParameters = $this->boundParameters;
                    if (is_array($input_parameters)) {
            Severity: Minor
            Found in src/Collectors/PDO/TraceablePDOStatement.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 runEqual has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private function runEqual($value)
                {
            
                    // Multiple equals.
                    if (strpos($this->data['rule'], '|') !== false) {
            Severity: Minor
            Found in src/Jury/Rule.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 profileCall has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function profileCall($method, $sql, array $args)
                {
                    if ($this->events !== null) {
                        $this->events->trigger('db.query', [$sql,$args]);
                    }
            Severity: Minor
            Found in src/Collectors/PDO/TraceablePDO.php - About 25 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 sentence has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function sentence($value, $target = '*', $tag = '*')
                {
                    $score = 0;
                    $ruleIds = [];
                    $normalizedValue = '';
            Severity: Minor
            Found in src/Jury/Judge.php - About 25 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 hook has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function hook($guard, $hook)
                {
                    $ourHook = function () use ($guard) {
                        $CI =& get_instance();
                        self::load($guard, $CI);
            Severity: Minor
            Found in src/Extensions/CodeIgniter/Bridge.php - About 25 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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                private function save(array $data = [])
                {
                    // If not writable, try to chmod it.
                    if (!is_writable($this->config['paths']['data'])) {
                        @chmod($this->config['paths']['data'], 0755);
            Severity: Minor
            Found in src/Install/Installer.php - About 25 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 getInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getInfo($parameter = '')
                {
                    $info = [
                        'method'        => $this->requestMethod,
                        'created'       => $this->created,
            Severity: Minor
            Found in src/Collectors/RequestCollector.php - About 25 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 deepAnalyze has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function deepAnalyze($exception)
                {
                    $this->issue('exceptions');
                    if (!$this->isInScope($exception)) {
                        // echo 'NON';
            Severity: Minor
            Found in src/Monitors/ExceptionsMonitor.php - About 25 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 run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function run()
                {
                    $files = array_slice(glob(__DIR__.'/../../tmp/cache/*.*'), 0, 5);
                    
                    foreach ($files as $file) {
            Severity: Minor
            Found in src/Queue/ShieldfyJob.php - About 25 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 analyzeFile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public function analyzeFile($input = '', $file = [])
                {
                    $score = 0;
                    $ruleIds = [];
            
            
            Severity: Minor
            Found in src/Monitors/UploadMonitor.php - About 25 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