Showing 529 of 599 total issues

Method eapBlock has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function eapBlock($eapType)
    {
        $realm = $this->determineOuterIdString();
        $retval = "<key>EAPClientConfiguration</key>
                  <dict>
Severity: Minor
Found in devices/apple_mobileconfig/MobileconfigSuperclass.php - About 1 hr to fix

    Method postProcessValidAttributes has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function postProcessValidAttributes(array $options, array &$good, array &$bad) {
            foreach ($options as $index => $iterateOption) {
                foreach ($iterateOption as $name => $optionPayload) {
                    switch ($name) {
                        case "eap:ca_url": // eap:ca_url becomes eap:ca_file by downloading the file
    Severity: Minor
    Found in web/lib/admin/OptionParser.php - About 1 hr to fix

      Method triggerNewOCSPStatement has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function triggerNewOCSPStatement($serial): string
          {
              $cert = new SilverbulletCertificate($serial, \devices\Devices::SUPPORT_EMBEDDED_ECDSA);
              $certstatus = "";
              // get all relevant info from object properties
      Severity: Minor
      Found in core/CertificationAuthorityEmbeddedECDSA.php - About 1 hr to fix

        Method triggerNewOCSPStatement has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function triggerNewOCSPStatement($serial): string
            {
                $cert = new SilverbulletCertificate($serial, \devices\Devices::SUPPORT_EMBEDDED_RSA);
                $certstatus = "";
                // get all relevant info from object properties
        Severity: Minor
        Found in core/CertificationAuthorityEmbeddedRSA.php - About 1 hr to fix

          Method createCArepository has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function createCArepository($tmpDir, &$intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
                  if (!mkdir($tmpDir . "/root-ca-allcerts/", 0700, true)) {
                      throw new Exception("unable to create root CA directory (RADIUS Tests): $tmpDir/root-ca-allcerts/\n");
                  }
                  if (!mkdir($tmpDir . "/root-ca-eaponly/", 0700, true)) {
          Severity: Minor
          Found in core/diag/RADIUSTests.php - About 1 hr to fix

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

                public function previewCAinHTML($cAReference) {
                    \core\common\Entity::intoThePotatoes();
                    $validator = new \web\lib\common\InputValidation();
                    $ref = $validator->databaseReference($cAReference);
                    $caExpiryTrashhold = \config\ConfAssistant::CERT_WARNINGS['expiry_warning'];
            Severity: Minor
            Found in web/lib/admin/UIElements.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 checkUploadSanity has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                    private function checkUploadSanity(string $optiontype, string $incomingBinary) {
                    switch ($optiontype) {
                        case "general:logo_file":
                        case "fed:logo_file":
                        case "internal:logo_from_url":
            Severity: Minor
            Found in web/lib/admin/OptionParser.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 furtherStringChecks has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                private function furtherStringChecks($attribute, $previsionalContent, &$bad) {
                    $content = FALSE;
                    switch ($attribute) {
                        case "media:consortium_OI":
                            $content = $this->validator->consortiumOI($previsionalContent);
            Severity: Minor
            Found in web/lib/admin/OptionParser.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 15 (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/DeviceLinuxSh.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 newIdP has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                public function newIdP($type, $ownerId, $level, $mail = NULL, $bestnameguess = NULL)
                {
                    $this->databaseHandle->exec("INSERT INTO institution (country, type) VALUES('$this->tld', '$type')");
                    $identifier = $this->databaseHandle->lastID();
            
            
            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 getIdpDistance has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                private static function getIdpDistance($idp, $location)
                {
                    $dist = 10000;
                    if (isset($idp['geo'])) {
                        $G = $idp['geo'];
            Severity: Minor
            Found in core/IdPlist.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 determineOwnCatalogue has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                private static function determineOwnCatalogue($showTrace = FALSE)
                {
                    $trace = debug_backtrace();
                    $caller = [];
                    // find the first caller in the stack trace which is NOT "Entity" itself
            Severity: Minor
            Found in core/common/Entity.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 createIdPFromToken has a Cognitive Complexity of 15 (exceeds 5 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

            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 sendRequestToCa has a Cognitive Complexity of 15 (exceeds 5 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: 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 thoroughChainChecks has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                private function thoroughChainChecks(&$testresults, &$intermOdditiesCAT, $tmpDir, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
            
                    $crlCheckString = $this->createCArepository($tmpDir, $intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs);
            // ... and run the verification test
                    $verifyResultEaponly = [];
            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 __validate_user_name has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

                def __validate_user_name(self) -> bool:
                    # locate the @ character in username
                    pos = self.username.find('@')
                    debug("@ position: " + str(pos))
                    # trailing @
            Severity: Minor
            Found in devices/linux/Files/main.py - 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 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

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

                public function __construct($identifier, $certtype = NULL)
                {
                    $this->databaseType = "INST";
                    parent::__construct();
                    $this->username = "";
            Severity: Minor
            Found in core/SilverbulletCertificate.php - About 1 hr to fix

              Method sendSMS has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function sendSMS($number, $content)
                  {
                      $loggerInstance = new \core\common\Logging();
                      switch (\config\ConfAssistant::SMSSETTINGS['provider']) {
                          case 'Nexmo':
              Severity: Minor
              Found in core/common/OutsideComm.php - About 1 hr to fix

                Function createMsgbox has 46 lines of code (exceeds 25 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 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language