shieldfy/shieldfy-php-client

View on GitHub

Showing 39 of 47 total issues

File block.blade.php has 6704 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
Severity: Major
Found in src/Extensions/Laravel/views/block.blade.php - About 2 wks to fix

    File block.blade.php has 6704 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <!DOCTYPE html>
    <html lang="en">
    
    <head>
        <meta charset="utf-8">
    Severity: Major
    Found in src/Extensions/Lumen/views/block.blade.php - About 2 wks to fix

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

      class TraceablePDO extends PDO
      {
          /** @var PDO */
          protected $pdo;
          public $events = null;
      Severity: Minor
      Found in src/Collectors/PDO/TraceablePDO.php - About 2 hrs to fix

        Function analyze has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
        Open

            public function analyze($object = '')
            {
                $request = $this->collectors['request'];
                $info = $request->getInfo();
                $params = array_merge($info['get'], $info['post'], $info['cookies']);
        Severity: Minor
        Found in src/Monitors/MemoryMonitor.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 deepAnalyze has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            public function deepAnalyze($content)
            {
                $foundGuilty = false;
                $charge = [];
                foreach ($this->infected as $infected):
        Severity: Minor
        Found in src/Monitors/ViewMonitor.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 analyze has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            public function analyze($query, $bindings = [])
            {
        
                // Get the parameters (all).
                $request = $this->collectors['request'];
        Severity: Minor
        Found in src/Monitors/DBMonitor.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 getDefaults has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getDefaults()
            {
                $defaults = [
                    "app_key"           => "",
                    "app_secret"        => "",
        Severity: Minor
        Found in src/Config.php - About 1 hr to fix

          Method analyzeFile has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function analyzeFile($input = '', $file = [])
              {
                  $score = 0;
                  $ruleIds = [];
          
          
          Severity: Minor
          Found in src/Monitors/UploadMonitor.php - About 1 hr to fix

            Method run has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function run()
                {
            
                    // Get the request info.
                    $request = $this->collectors['request'];
            Severity: Minor
            Found in src/Monitors/UploadMonitor.php - About 1 hr to fix

              Method update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function update()
                  {
                      $response = $this->dispatcher->trigger('update', [
                          'sdk_version'=>$this->config['version'],
                          'php_version'=>PHP_VERSION,
              Severity: Minor
              Found in src/Callbacks/UpdateCallback.php - About 1 hr to fix

                Method sendToJail has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function sendToJail($severity = 'low', $charge  = [], $code = [])
                    {
                
                        // Based on severity and config. Let's judge it.
                        $incidentId = $this->generateIncidentId($this->collectors['user']->getId());
                Severity: Minor
                Found in src/Monitors/MonitorBase.php - About 1 hr to fix

                  Method analyze has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function analyze($query, $bindings = [])
                      {
                  
                          // Get the parameters (all).
                          $request = $this->collectors['request'];
                  Severity: Minor
                  Found in src/Monitors/DBMonitor.php - About 1 hr to fix

                    Method deepAnalyze has 26 lines of code (exceeds 25 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 1 hr to fix

                      Method logInternalError has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function logInternalError($exception)
                          {
                              if (!is_writable($this->config['logsDir'])) {
                                  return;
                              }
                      Severity: Minor
                      Found in src/Collectors/ExceptionsCollector.php - About 1 hr to fix

                        Function run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function run($value, $target = '*', $tag = '*')
                            {
                                if ($target !== '*' && $target !== $this->data['target']) {
                                    return;
                                }
                        Severity: Minor
                        Found in src/Jury/Rule.php - About 55 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 exposeHeaders has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function exposeHeaders()
                            {
                                if (function_exists('header_remove')) {
                                    header_remove('x-powered-by');
                                } else {
                        Severity: Minor
                        Found in src/Guard.php - About 55 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 collectFromStack has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function collectFromStack()
                            {
                                $stack = array_reverse($this->stack);
                        
                                foreach ($this->stack as $trace):
                        Severity: Minor
                        Found in src/Collectors/CodeCollector.php - About 55 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 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

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

                            public function handleExceptions($exception, $is_exception = true)
                            {
                                if ($this->callback !== null) {
                                    call_user_func($this->callback, $exception);
                                }
                        Severity: Minor
                        Found in src/Collectors/ExceptionsCollector.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

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

                            protected function sendToJail($severity = 'low', $charge  = [], $code = [])
                            {
                        
                                // Based on severity and config. Let's judge it.
                                $incidentId = $this->generateIncidentId($this->collectors['user']->getId());
                        Severity: Minor
                        Found in src/Monitors/MonitorBase.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

                        Severity
                        Category
                        Status
                        Source
                        Language