jumper423/decaptcha

View on GitHub

Showing 39 of 73 total issues

Method __construct has 457 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct($class)
    {
        $this->class = $class;
        $this->texts = [
            'constructor_data' => [
Severity: Major
Found in src/core/DeCaptchaWiki.php - About 2 days to fix

    File DeCaptchaWiki.php has 724 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace jumper423\decaptcha\core;
    
    /**
    Severity: Major
    Found in src/core/DeCaptchaWiki.php - About 1 day to fix

      Method init has 287 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function init()
          {
              parent::init();
      
              $this->actions[static::ACTION_RECOGNIZE] = [
      Severity: Major
      Found in src/services/RuCaptcha.php - About 1 day to fix

        Method init has 231 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function init()
            {
                parent::init();
        
                $this->actions[static::ACTION_RECOGNIZE] = [
        Severity: Major
        Found in src/services/Anticaptcha.php - About 1 day to fix

          Method init has 139 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function init()
              {
                  parent::init();
          
                  unset(
          Severity: Major
          Found in src/services/RuCaptchaKeyCaptcha.php - About 5 hrs to fix

            Method init has 136 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function init()
                {
                    parent::init();
            
                    unset(
            Severity: Major
            Found in src/services/RuCaptchaReCaptchaV3.php - About 5 hrs to fix

              Function decodeResponse has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function decodeResponse($action, $data)
                  {
                      if (!array_key_exists($action, $this->decodeSettings[static::DECODE_ACTION])) {
                          throw new DeCaptchaErrors('нет action');
                      }
              Severity: Minor
              Found in src/core/DeCaptchaAbstract.php - About 4 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 init has 98 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function init()
                  {
                      parent::init();
              
                      unset(
              Severity: Major
              Found in src/services/RuCaptchaFunCaptcha.php - About 3 hrs to fix

                File RuCaptcha.php has 330 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace jumper423\decaptcha\services;
                
                use jumper423\decaptcha\core\DeCaptchaBase;
                Severity: Minor
                Found in src/services/RuCaptcha.php - About 3 hrs to fix

                  Function getParams has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function getParams($action, $field = null)
                      {
                          if (empty($this->actions[$action])) {
                              return [];
                          }
                  Severity: Minor
                  Found in src/core/DeCaptchaAbstract.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 init has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function init()
                      {
                          parent::init();
                  
                          unset(
                  Severity: Major
                  Found in src/services/RuCaptchaGeeTest.php - About 3 hrs to fix

                    Method init has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function init()
                        {
                            parent::init();
                    
                            unset(
                    Severity: Major
                    Found in src/services/RuCaptchaReCaptcha.php - About 3 hrs to fix

                      Method init has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function init()
                          {
                              parent::init();
                      
                              $this->paramsNames[static::ACTION_FIELD_PROXYTYPE] = 'proxyType';
                      Severity: Major
                      Found in src/services/AnticaptchaReCaptcha.php - About 2 hrs to fix

                        File Anticaptcha.php has 284 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        namespace jumper423\decaptcha\services;
                        
                        use jumper423\decaptcha\core\DeCaptchaBase;
                        Severity: Minor
                        Found in src/services/Anticaptcha.php - About 2 hrs to fix

                          File DeCaptchaAbstract.php has 281 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          
                          namespace jumper423\decaptcha\core;
                          
                          use Exception;
                          Severity: Minor
                          Found in src/core/DeCaptchaAbstract.php - About 2 hrs to fix

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

                                public function init()
                                {
                                    parent::init();
                            
                                    unset(
                            Severity: Major
                            Found in src/services/AnticaptchaReCaptchaProxeless.php - About 2 hrs to fix

                              Method init has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function init()
                                  {
                                      parent::init();
                              
                                      unset(
                              Severity: Major
                              Found in src/services/Pixodrom.php - About 2 hrs to fix

                                Method viewExamples has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function viewExamples()
                                    {
                                        $class = $this->class;
                                        $reflection = (new \ReflectionClass($class));
                                
                                
                                Severity: Major
                                Found in src/core/DeCaptchaWiki.php - About 2 hrs to fix

                                  Method init has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function init()
                                      {
                                          parent::init();
                                  
                                          unset(
                                  Severity: Major
                                  Found in src/services/RuCaptchaGrid.php - About 2 hrs to fix

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

                                        protected function viewFields()
                                        {
                                            $class = $this->class;
                                            $str = " {$this->getText(['table', 'th', 'name'])} | {$this->getText(['table', 'th', 'code'])} | {$this->getText(['table', 'th', 'type'])} | {$this->getText(['table', 'th', 'req'])} | {$this->getText(['table', 'th', 'def'])} | {$this->getText(['table', 'th', 'enum'])} | {$this->getText(['table', 'th', 'desc'])} ".PHP_EOL;
                                            $str .= ' --- | --- | --- | --- | --- | --- | --- '.PHP_EOL;
                                    Severity: Minor
                                    Found in src/core/DeCaptchaWiki.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