shieldfy/normalizer

View on GitHub

Showing 11 of 18 total issues

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

    public function run()
    {
        $matches = [];

        // check if value matches typical charCode pattern
Severity: Minor
Found in src/Normalizers/NormalizeJSCharcode.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 run has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {

        // critical ctrl values
        $search = [
Severity: Major
Found in src/Normalizers/NormalizeControlChars.php - About 2 hrs to fix

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

        public function run()
        {
            $matches = [];
    
            // check if value matches typical charCode pattern
    Severity: Minor
    Found in src/Normalizers/NormalizeJSCharcode.php - About 1 hr to fix

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

          public function run()
          {
              if (! $this->runPreSearch()) {
                  return $this->value;
              }
      Severity: Minor
      Found in src/Normalizers/NormalizeUTF7.php - About 1 hr to fix

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

            public function run()
            {
                //normalize remaining backslashes
                if ($this->value != preg_replace('/(\w)\\\/', '$1', $this->value)) {
                    $this->value .= preg_replace('/(\w)\\\/', '$1', $this->value);
        Severity: Minor
        Found in src/Normalizers/NormalizeConcatenated.php - About 1 hr to fix

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

              public function run()
              {
                  if (! $this->runPreSearch()) {
                      return $this->value;
                  }
          Severity: Minor
          Found in src/Normalizers/NormalizeSerialize.php - About 1 hr to fix

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

                public function run()
                {
                    if (! $this->runPreSearch()) {
                        return $this->value;
                    }
            Severity: Minor
            Found in src/Normalizers/NormalizeSQLHex.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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function run()
                {
                    if (! $this->runPreSearch()) {
                        return $this->value;
                    }
            Severity: Minor
            Found in src/Normalizers/NormalizeSerialize.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

            Avoid too many return statements within this method.
            Open

                        return $this->value;
            Severity: Major
            Found in src/Normalizers/NormalizeSerialize.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $this->value;
              Severity: Major
              Found in src/Normalizers/NormalizeSerialize.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        return $decoded;
                Severity: Major
                Found in src/Normalizers/NormalizeSerialize.php - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language