jumper423/decaptcha

View on GitHub

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

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            unset(
                $this->paramsNames[static::ACTION_FIELD_FILE],
                $this->paramsNames[static::ACTION_FIELD_PHRASE],
                $this->paramsNames[static::ACTION_FIELD_REGSENSE],
                $this->paramsNames[static::ACTION_FIELD_NUMERIC],
    Severity: Major
    Found in src/services/RuCaptchaGeeTest.php and 3 other locations - About 1 day to fix
    src/services/RuCaptchaFunCaptcha.php on lines 14..37
    src/services/RuCaptchaKeyCaptcha.php on lines 14..37
    src/services/RuCaptchaReCaptcha.php on lines 14..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 376.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            unset(
                $this->paramsNames[static::ACTION_FIELD_FILE],
                $this->paramsNames[static::ACTION_FIELD_PHRASE],
                $this->paramsNames[static::ACTION_FIELD_REGSENSE],
                $this->paramsNames[static::ACTION_FIELD_NUMERIC],
    Severity: Major
    Found in src/services/RuCaptchaKeyCaptcha.php and 3 other locations - About 1 day to fix
    src/services/RuCaptchaFunCaptcha.php on lines 14..37
    src/services/RuCaptchaGeeTest.php on lines 16..39
    src/services/RuCaptchaReCaptcha.php on lines 14..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 376.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            unset(
                $this->paramsNames[static::ACTION_FIELD_FILE],
                $this->paramsNames[static::ACTION_FIELD_PHRASE],
                $this->paramsNames[static::ACTION_FIELD_REGSENSE],
                $this->paramsNames[static::ACTION_FIELD_NUMERIC],
    Severity: Major
    Found in src/services/RuCaptchaFunCaptcha.php and 3 other locations - About 1 day to fix
    src/services/RuCaptchaGeeTest.php on lines 16..39
    src/services/RuCaptchaKeyCaptcha.php on lines 14..37
    src/services/RuCaptchaReCaptcha.php on lines 14..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 376.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 4 locations. Consider refactoring.
    Open

            unset(
                $this->paramsNames[static::ACTION_FIELD_FILE],
                $this->paramsNames[static::ACTION_FIELD_PINGBACK],
                $this->paramsNames[static::ACTION_FIELD_NUMERIC],
                $this->paramsNames[static::ACTION_FIELD_MIN_LEN],
    Severity: Major
    Found in src/services/RuCaptchaReCaptcha.php and 3 other locations - About 1 day to fix
    src/services/RuCaptchaFunCaptcha.php on lines 14..37
    src/services/RuCaptchaGeeTest.php on lines 16..39
    src/services/RuCaptchaKeyCaptcha.php on lines 14..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 376.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open

                      <?php
                      
                      namespace jumper423\decaptcha\services;
                      
                      /**
                      Severity: Major
                      Found in src/services/TwoCaptchaReCaptcha.php and 5 other locations - About 3 hrs to fix
                      src/services/TwoCaptchaFunCaptcha.php on lines 1..32
                      src/services/TwoCaptchaGeeTest.php on lines 1..32
                      src/services/TwoCaptchaGrid.php on lines 1..32
                      src/services/TwoCaptchaInstruction.php on lines 1..32
                      src/services/TwoCaptchaReCaptchaV3.php on lines 1..32

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 153.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open

                      <?php
                      
                      namespace jumper423\decaptcha\services;
                      
                      /**
                      Severity: Major
                      Found in src/services/TwoCaptchaReCaptchaV3.php and 5 other locations - About 3 hrs to fix
                      src/services/TwoCaptchaFunCaptcha.php on lines 1..32
                      src/services/TwoCaptchaGeeTest.php on lines 1..32
                      src/services/TwoCaptchaGrid.php on lines 1..32
                      src/services/TwoCaptchaInstruction.php on lines 1..32
                      src/services/TwoCaptchaReCaptcha.php on lines 1..32

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 153.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open

                      <?php
                      
                      namespace jumper423\decaptcha\services;
                      
                      /**
                      Severity: Major
                      Found in src/services/TwoCaptchaInstruction.php and 5 other locations - About 3 hrs to fix
                      src/services/TwoCaptchaFunCaptcha.php on lines 1..32
                      src/services/TwoCaptchaGeeTest.php on lines 1..32
                      src/services/TwoCaptchaGrid.php on lines 1..32
                      src/services/TwoCaptchaReCaptcha.php on lines 1..32
                      src/services/TwoCaptchaReCaptchaV3.php on lines 1..32

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 153.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 6 locations. Consider refactoring.
                      Open

                      <?php
                      
                      namespace jumper423\decaptcha\services;
                      
                      /**
                      Severity: Major
                      Found in src/services/TwoCaptchaFunCaptcha.php and 5 other locations - About 3 hrs to fix
                      src/services/TwoCaptchaGeeTest.php on lines 1..32
                      src/services/TwoCaptchaGrid.php on lines 1..32
                      src/services/TwoCaptchaInstruction.php on lines 1..32
                      src/services/TwoCaptchaReCaptcha.php on lines 1..32
                      src/services/TwoCaptchaReCaptchaV3.php on lines 1..32

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 153.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language