Showing 529 of 599 total issues

Method productheader has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function productheader($area) {
        \core\common\Entity::intoThePotatoes();
        $language = $this->languageInstance->getLang();
        // this <div is closing in footer, keep it in PHP for Netbeans syntax
        // highlighting to work
Severity: Major
Found in web/lib/admin/PageDecoration.php - About 2 hrs to fix

    File RFC6614Tests.php has 263 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/RFC6614Tests.php - About 2 hrs to fix

      File accountstatus.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*
       * Contributions to this work were made on behalf of the GÉANT project, a 
       * project that has received funding from the European Union’s Horizon 2020 
       * research and innovation programme under Grant Agreement No. 731122 (GN4-2).
      Severity: Minor
      Found in web/skins/modern/accountstatus/accountstatus.php - About 2 hrs to fix

        Function writeInstaller has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public function writeInstaller()
            {
                $dom = textdomain(NULL);
                textdomain("devices");
                // create certificate files and save their names in $caFiles array
        Severity: Minor
        Found in devices/ms/DeviceVista7.php - About 2 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 listIdentityProvidersWithProfiles has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function listIdentityProvidersWithProfiles() {
                $handle = DBConnection::handle("INST");
                $handle->exec("SET SESSION group_concat_max_len=10000");
                $idpQuery = IdPlist::setAllIdentyProvidersQuery(1);
                $allIDPs = $handle->exec($idpQuery);
        Severity: Minor
        Found in core/IdPlist.php - About 2 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 packetCountEvaluation has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            private function packetCountEvaluation(&$testresults, $packetcount) {
                $reqs = $packetcount[1] ?? 0;
                $accepts = $packetcount[2] ?? 0;
                $rejects = $packetcount[3] ?? 0;
                $challenges = $packetcount[11] ?? 0;
        Severity: Minor
        Found in core/diag/RADIUSTests.php - About 2 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 significantChanges has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function significantChanges($old, $new)
            {
                $retval = [];
                // check if a CA was added
                $x509 = new common\X509();
        Severity: Minor
        Found in core/AbstractProfile.php - About 2 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 signRequest has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public function signRequest($csr, $expiryDays): array
            {
                if ($csr["CSR_STRING"] === NULL) {
                    throw new Exception("This CA needs the CSR in a string (PEM)!");
                }
        Severity: Minor
        Found in core/CertificationAuthorityEduPki.php - About 2 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 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            def __get_username_password(self) -> None:
                """
                read user password and set the password property
                do nothing if silent mode is set
                """
        Severity: Minor
        Found in devices/linux/Files/main.py - About 2 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 listAllIdentityProviders has 56 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function listAllIdentityProviders($activeOnly = 0, $country = "")
            {
                common\Entity::intoThePotatoes();
                $handle = DBConnection::handle("INST");
                $handle->exec("SET SESSION group_concat_max_len=10000");
        Severity: Major
        Found in core/CAT.php - About 2 hrs to fix

          File MapGoogle.php has 259 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          /*
           * *****************************************************************************
           * Contributions to this work were made on behalf of the GÉANT project, a 
           * project that has received funding from the European Union’s Framework 
          Severity: Minor
          Found in web/lib/admin/MapGoogle.php - About 2 hrs to fix

            Method scrub has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function scrub($inputJson, $fedObject) {        
                    $optionInstance = \core\Options::instance();
                    $parameters = [];
                    $allPossibleAttribs = array_merge(API::ACTIONS[$inputJson['ACTION']]['REQ'], API::ACTIONS[$inputJson['ACTION']]['OPT'],  API::ACTIONS[$inputJson['ACTION']]['FLAG']);
                    // some actions don't need parameters. Don't get excited when there aren't any.
            Severity: Major
            Found in web/lib/admin/API.php - About 2 hrs to fix

              Method writeConfigVars has 55 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function writeConfigVars($file) {
                      $eapMethod = \core\common\EAP::eapDisplayName($this->selectedEap);
                      $contacts = $this->mkSupportContacts();
                      $tou = $this->mkUserConsent();
                      $outerId = $this->determineOuterIdString();
              Severity: Major
              Found in devices/linux/DeviceLinux.php - About 2 hrs to fix

                Method furtherStringChecks has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function furtherStringChecks($attribute, $previsionalContent, &$bad) {
                        $content = FALSE;
                        switch ($attribute) {
                            case "media:consortium_OI":
                                $content = $this->validator->consortiumOI($previsionalContent);
                Severity: Major
                Found in web/lib/admin/OptionParser.php - About 2 hrs to fix

                  Method udpLogin has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function udpLogin($probeindex, $eaptype, $innerUser, $password, $opnameCheck = TRUE, $frag = TRUE, $clientcertdata = NULL) {
                          $preliminaries = $this->udpLoginPreliminaries($probeindex, $eaptype, $clientcertdata);
                          if ($preliminaries !== TRUE) {
                              return $preliminaries;
                          }
                  Severity: Major
                  Found in core/diag/RADIUSTests.php - About 2 hrs to fix

                    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

                      Method mailAddressValidSecure has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function mailAddressValidSecure($address)
                          {
                              $loggerInstance = new \core\common\Logging();
                              if (!filter_var($address, FILTER_VALIDATE_EMAIL)) {
                                  $loggerInstance->debug(4, "OutsideComm::mailAddressValidSecure: invalid mail address.");
                      Severity: Major
                      Found in core/common/OutsideComm.php - About 2 hrs to fix

                        File adminQuery.php has 254 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/adminQuery.php - About 2 hrs to fix

                          Function sendOptionsToDatabase has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function sendOptionsToDatabase($object, array $options, array $pendingattributes, string $device = NULL, int $eaptype = NULL) {
                                  $retval = [];
                                  foreach ($options as $iterateOption) {
                                      foreach ($iterateOption as $name => $optionPayload) {
                                          $optiontype = $this->optioninfoObject->optionType($name);
                          Severity: Minor
                          Found in web/lib/admin/OptionParser.php - About 2 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 createMsgbox has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function createMsgbox(type, onclick) {
                              var body = document.getElementsByTagName("body")[0];
                              if (document.getElementById("overlay") === null) {
                                  var overlay = document.createElement("div");
                                  overlay.setAttribute("id", "overlay");
                          Severity: Minor
                          Found in web/admin/js/popup_redirect.js - About 2 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

                          Severity
                          Category
                          Status
                          Source
                          Language