core/diag/RFC7585Tests.php

Summary

Maintainability
D
1 day
Test Coverage

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

    public function relevantNAPTRhostnameResolution()
    {
// make sure the previous tests have been run before we go on
// preceding tests will cascade automatically if needed
        if ($this->NAPTR_SRV_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
Severity: Minor
Found in core/diag/RFC7585Tests.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 relevantNAPTRhostnameResolution has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function relevantNAPTRhostnameResolution()
    {
// make sure the previous tests have been run before we go on
// preceding tests will cascade automatically if needed
        if ($this->NAPTR_SRV_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
Severity: Major
Found in core/diag/RFC7585Tests.php - About 2 hrs to fix

    Function relevantNAPTRcompliance has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public function relevantNAPTRcompliance()
        {
    // did we query DNS for the NAPTRs yet? If not, do so now.
            if ($this->NAPTR_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
                $this->relevantNAPTR();
    Severity: Minor
    Found in core/diag/RFC7585Tests.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 relevantNAPTRsrvResolution has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        public function relevantNAPTRsrvResolution()
        {
    // see if preceding checks have been run, and run them if not
    // compliance check will cascade NAPTR check on its own
            if ($this->NAPTR_compliance_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
    Severity: Minor
    Found in core/diag/RFC7585Tests.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 relevantNAPTRsrvResolution has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function relevantNAPTRsrvResolution()
        {
    // see if preceding checks have been run, and run them if not
    // compliance check will cascade NAPTR check on its own
            if ($this->NAPTR_compliance_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
    Severity: Minor
    Found in core/diag/RFC7585Tests.php - About 1 hr to fix

      Method relevantNAPTR has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function relevantNAPTR()
          {
              if ($this->discoveryTag == "") {
                  $this->NAPTR_executed = RADIUSTests::RETVAL_NOTCONFIGURED;
                  return RADIUSTests::RETVAL_NOTCONFIGURED;
      Severity: Minor
      Found in core/diag/RFC7585Tests.php - About 1 hr to fix

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

            public function relevantNAPTRcompliance()
            {
        // did we query DNS for the NAPTRs yet? If not, do so now.
                if ($this->NAPTR_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
                    $this->relevantNAPTR();
        Severity: Minor
        Found in core/diag/RFC7585Tests.php - About 1 hr to fix

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

              public function relevantNAPTR()
              {
                  if ($this->discoveryTag == "") {
                      $this->NAPTR_executed = RADIUSTests::RETVAL_NOTCONFIGURED;
                      return RADIUSTests::RETVAL_NOTCONFIGURED;
          Severity: Minor
          Found in core/diag/RFC7585Tests.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

          There are no issues that match your filters.

          Category
          Status