Showing 529 of 599 total issues

Function createTokens has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function createTokens($isByFedadmin, $for, $instIdentifier, $externalId = 0, $country = 0, $partType = 0)
    {
        $level = ($isByFedadmin ? "FED" : "INST");
        $tokenList = [];
        foreach ($for as $oneDest) {
Severity: Minor
Found in core/UserManagement.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 processCertificate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function processCertificate($cadata)
    {
        $pemBegin = strpos($cadata, "-----BEGIN CERTIFICATE-----");
        if ($pemBegin !== FALSE) {
            $pemEnd = strpos($cadata, "-----END CERTIFICATE-----") + 25;
Severity: Minor
Found in core/common/X509.php - About 1 hr to fix

    Method __construct has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct($visibility = 'all', $selectedLang = '') {
            $langsArray = [];
            foreach (\config\Master::LANGUAGES as $lang => $value) {
                if ($lang == $selectedLang) {
                    $langsArray[] = ['text'=>$value['display'], 'link'=>'javascript:changeLang("' . $lang . '")', 'class'=>'selected-lang'];
    Severity: Minor
    Found in web/skins/modern/Menu.php - About 1 hr to fix

      Method __construct has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct($profileId, $idpObject = NULL)
          {
              parent::__construct($profileId, $idpObject);
      
              $this->entityOptionTable = "profile_option";
      Severity: Minor
      Found in core/ProfileRADIUS.php - About 1 hr to fix

        Method listAllIdentityProviders has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Method pickupFinalCert has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function pickupFinalCert($soapReqnum, $wait)
              {
                  try {
                      $soap = $this->initEduPKISoapSession("RA");
                      $counter = 0;
          Severity: Minor
          Found in core/CertificationAuthorityEduPkiServer.php - About 1 hr to fix

            Method createIdPFromToken has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function createIdPFromToken(string $token, string $owner)
                {
                    new CAT(); // be sure that Entity's static members are initialised
                    common\Entity::intoThePotatoes();
                    // the token either has cat_institution_id set -> new admin for existing inst
            Severity: Minor
            Found in core/UserManagement.php - About 1 hr to fix

              Method opensslCAResult has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function opensslCAResult($host, $opensslbabble)
                  {
                      if (preg_match('/connect: Connection refused/', implode($opensslbabble))) {
                          $this->TLS_CA_checks_result[$host]['status'] = RADIUSTests::RETVAL_CONNECTION_REFUSED;
                          return RADIUSTests::RETVAL_INVALID;
              Severity: Minor
              Found in core/diag/RFC6614Tests.php - About 1 hr to fix

                Function prefillText has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function prefillText(int $rowid, string $optionName, string $optionValue, $optionLang)
                    {
                        \core\common\Entity::intoThePotatoes();
                        $retval = "";
                        $optioninfo = \core\Options::instance();
                Severity: Minor
                Found in web/lib/admin/OptionDisplay.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 productheader has a Cognitive Complexity of 13 (exceeds 5 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: Minor
                Found in web/lib/admin/PageDecoration.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 listIdentityProviders has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function listIdentityProviders($activeOnly = 0)
                    {
                        // maybe we did this exercise before?
                        if ($activeOnly != 0 && count($this->idpListActive) > 0) {
                            return $this->idpListActive;
                Severity: Minor
                Found in core/Federation.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 listExternalEntities has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function listExternalEntities($unmappedOnly, $type = NULL)
                    {
                        $allExternals = [];
                        $usedarray = [];
                        $returnarray = [];
                Severity: Minor
                Found in core/Federation.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 testPhpModules has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function testPhpModules()
                    {
                        if (function_exists('idn_to_ascii')) {
                            $this->storeTestResult(\core\common\Entity::L_OK, "PHP can handle internationalisation.");
                        } else {
                Severity: Minor
                Found in core/SanityTests.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 listAllIdentityProviders has a Cognitive Complexity of 13 (exceeds 5 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: Minor
                Found in core/CAT.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 writeConfigVars has a Cognitive Complexity of 13 (exceeds 5 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: Minor
                Found in devices/linux/DeviceLinux.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 magic has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function magic()
                    {
                        $this->testId = \core\CAT::uuid();
                        $this->databaseHandle->exec("INSERT INTO diagnosticrun (test_id, realm, suspects, evidence) VALUES ('$this->testId', '$this->realm', NULL, NULL)");
                        // simple things first: do we know anything about the realm, either
                Severity: Minor
                Found in core/diag/Telepath.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 pickupFinalCert has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function pickupFinalCert($soapReqnum, $wait)
                    {
                        try {
                            $soap = $this->initEduPKISoapSession("RA");
                            $counter = 0;
                Severity: Minor
                Found in core/CertificationAuthorityEduPkiServer.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 __construct has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function __construct($realm, $outerUsernameForChecks, $supportedEapTypes = [], $expectedServerNames = [], $expectedCABundle = []) {
                        parent::__construct();
                
                        $this->realm = $realm;
                        $this->outerUsernameForChecks = $outerUsernameForChecks;
                Severity: Minor
                Found in core/diag/RADIUSTests.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

                Function getCollapsedAttributes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getCollapsedAttributes($eap = [])
                    {
                        $collapsedList = [];
                        foreach ($this->getAttributes() as $attribute) {
                            // filter out eap-level attributes not pertaining to EAP type $eap
                Severity: Minor
                Found in core/AbstractProfile.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

                Severity
                Category
                Status
                Source
                Language