Showing 529 of 599 total issues

Function downloadStatsCore has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    private function downloadStatsCore($detail = '')
    {
        if ($detail !== 'ORGANISATIONS' && $detail !== 'PROFILES' && $detail !== 'FEDERATION') {
            $detail = 'NONE';
        }
Severity: Minor
Found in core/Federation.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 openroamingRedinessTest has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function openroamingRedinessTest() {
        // do OpenRoaming initial diagnostic checks
        // numbers correspond to RFC7585Tests::OVERALL_LEVEL
        $results = [];
        $resultLevel = $this::OVERALL_OPENROAMING_LEVEL_GOOD; // assume all is well, degrade if we have concrete findings to suggest otherwise
Severity: Major
Found in core/AbstractProfile.php - About 4 hrs to fix

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

        public function printOverview()
        {
            $out = [];
            $out[] = "<fieldset class='option_container'>
            <legend>
    Severity: Minor
    Found in core/diag/RADIUSTestsUI.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

    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 sendRequestToCa has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function sendRequestToCa($csr, $revocationPin, $expiryDays): int
        {
            // initialise connection to eduPKI CA / eduroam RA and send the request to them
            try {            
                if (in_array("eduroam IdP", $csr["POLICIES"]) && in_array("eduroam SP", $csr["POLICIES"])) {
    Severity: Major
    Found in core/CertificationAuthorityEduPkiServer.php - About 4 hrs to fix

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

          private function determineMailsToSend() {
              $this->mailQueue = [];
      // check for IDP_EXISTS_BUT_NO_DATABASE
              if (!in_array(AbstractTest::INFRA_NONEXISTENTREALM, $this->possibleFailureReasons) && $this->additionalFindings[AbstractTest::INFRA_NONEXISTENTREALM]['DATABASE_STATUS']['ID2'] < 0) {
                  $this->mailQueue[] = Logopath::IDP_EXISTS_BUT_NO_DATABASE;
      Severity: Minor
      Found in core/diag/Logopath.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 collectClients has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function collectClients()
          {
              $clientstest = [];
              foreach ($this->allReachabilityResults['clients'] as $clients) {
                  if ($clients->result == RADIUSTests::RETVAL_SKIPPED) {
      Severity: Major
      Found in core/diag/RADIUSTestsUI.php - About 3 hrs to fix

        File radius_tests.php has 323 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /*
         * *****************************************************************************
         * Contributions to this work were made on behalf of the GÉANT project, a 
        Severity: Minor
        Found in web/diag/radius_tests.php - About 3 hrs to fix

          Function infoblock has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

              public function infoblock(array $optionlist, string $class, string $level) {
                  \core\common\Entity::intoThePotatoes();
                  $locationMarkers = [];
                  $retval = "";
                  $optioninfo = \core\Options::instance();
          Severity: Minor
          Found in web/lib/admin/UIElements.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

          Function __get_username_password_atomic has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

              def __get_username_password_atomic(self) -> None:
                  """
                  use single form to get username, password and password confirmation
                  """
                  output_fields_separator = "\n\n\n\n\n"
          Severity: Minor
          Found in devices/linux/Files/main.py - 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

          Function __process_p12 has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
          Open

              def __process_p12(self) -> bool:
                  debug('process_p12')
                  pfx_file = get_config_path() + '/cat_installer/user.p12'
                  if CRYPTO_AVAILABLE:
                      debug("using crypto")
          Severity: Minor
          Found in devices/linux/Files/main.py - 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 printOverview has 90 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function printOverview()
              {
                  $out = [];
                  $out[] = "<fieldset class='option_container'>
                  <legend>
          Severity: Major
          Found in core/diag/RADIUSTestsUI.php - About 3 hrs to fix

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

                public function printStatic()
                {
                    $out = [];
                    $out[] = '<fieldset class="option_container" id="static_tests">
                              <legend><strong>';
            Severity: Minor
            Found in core/diag/RADIUSTestsUI.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 adminInvitationMail has 89 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function adminInvitationMail($targets, $introtext, $newtoken, $idpPrettyName, $federation, $type)
                {
                    if (!in_array($introtext, OutsideComm::INVITE_CONTEXTS)) {
                        throw new \Exception("Unknown invite mode!");
                    }
            Severity: Major
            Found in core/common/OutsideComm.php - About 3 hrs to fix

              Method listDevices has 88 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function listDevices()
                  {
                      $returnarray = [];
                      $redirect = $this->getAttributes("device-specific:redirect"); // this might return per-device ones or the general one
                      // if it was a general one, we are done. Find out if there is one such
              Severity: Major
              Found in core/AbstractProfile.php - About 3 hrs to fix

                SanityTests has 29 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class SanityTests extends CAT
                {
                    /* in this section set current CAT requirements */
                
                    /**
                Severity: Minor
                Found in core/SanityTests.php - About 3 hrs to fix

                  AbstractProfile has 29 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  abstract class AbstractProfile extends EntityWithDBProperties
                  {
                  
                      const HIDDEN = -1;
                      const AVAILABLE = 0;
                  Severity: Minor
                  Found in core/AbstractProfile.php - About 3 hrs to fix

                    File IdP.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    /*
                     * *****************************************************************************
                     * Contributions to this work were made on behalf of the GÉANT project, a 
                    Severity: Minor
                    Found in core/IdP.php - About 3 hrs to fix

                      File Telepath.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /*
                       * *****************************************************************************
                       * Contributions to this work were made on behalf of the GÉANT project, a 
                      Severity: Minor
                      Found in core/diag/Telepath.php - About 3 hrs to fix

                        Method sanitiseInputs has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function sanitiseInputs(array $listOfEntries) {
                                $retval = [];
                                $bad = [];
                                $multilangAttrsWithC = [];
                                foreach ($listOfEntries as $objId => $objValueRaw) {
                        Severity: Major
                        Found in web/lib/admin/OptionParser.php - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language