RobThree/TwoFactorAuth

View on GitHub

Showing 4 of 4 total issues

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

    public function __construct(protected bool $verifyssl = true, public string $errorcorrectionlevel = 'L', public int $margin = 4, public int $qzone = 1, public string $bgcolor = 'ffffff', public string $color = '000000', public string $format = 'png')
Severity: Major
Found in lib/Providers/Qr/QRServerProvider.php - About 50 mins to fix

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

        public function __construct(protected bool $verifyssl = true, public string $errorcorrectionlevel = 'L', public string $bgcolor = 'ffffff', public string $color = '000000', public string $format = 'p')
    Severity: Minor
    Found in lib/Providers/Qr/QRicketProvider.php - About 35 mins to fix

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

          public function getQRCodeImage(string $qrText, int $size): string
          {
              if (!$this->endroid4) {
                  return $this->qrCodeInstance($qrText, $size)->writeString();
              }
      Severity: Minor
      Found in lib/Providers/Qr/EndroidQrCodeWithLogoProvider.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

      Avoid too many return statements within this method.
      Open

                      return 'application/postscript';
      Severity: Major
      Found in lib/Providers/Qr/QRServerProvider.php - About 30 mins to fix
        Severity
        Category
        Status
        Source
        Language