Showing 529 of 599 total issues

Method setRADIUSconfig has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setRADIUSconfig($onlyone = 0, $notify = 0)
    {
        $remove = ($this->status == \core\AbstractDeployment::INACTIVE) ? 0 : 1;
        $toPost = ($onlyone ? array($onlyone => '') : array(1 => '', 2 => ''));
        $toPostTemplate = 'instid=' . $this->institution . '&deploymentid=' . $this->identifier . '&secret=' . $this->secret . '&country=' . $this->getAttributes("internal:country")[0]['value'] . '&';
Severity: Minor
Found in core/DeploymentManaged.php - About 1 hr to fix

    Method opensslClientsResult has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function opensslClientsResult($host, $opensslbabble, &$testresults, $type = '', $resultArrayKey = 0)
        {
            \core\common\Entity::intoThePotatoes();
            $res = RADIUSTests::RETVAL_OK;
            $ret = $testresults[$host]['ca'][$type]['certificate'][$resultArrayKey]['returncode'];
    Severity: Minor
    Found in core/diag/RFC6614Tests.php - About 1 hr to fix

      Method testMailer has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function testMailer()
          {
              if (empty(\config\Master::APPEARANCE['abuse-mail']) || \config\Master::APPEARANCE['abuse-mail'] == "my-abuse-contact@your-cat-installation.example") {
                  $this->storeTestResult(\core\common\Entity::L_ERROR, "Your abuse-mail has not been set, cannot continue with mailer tests.");
                  return;
      Severity: Minor
      Found in core/SanityTests.php - About 1 hr to fix

        Method writeMessages has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function writeMessages($file) {
                \core\common\Entity::intoThePotatoes();
                $messages = [
                'QUIT'=> _("Really quit?"),
                'USERNAME_PROMPT'=> _("enter your userid"),
        Severity: Minor
        Found in devices/linux/DeviceLinuxSh.php - About 1 hr to fix

          Method testDeviceCache has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function testDeviceCache()
              {
                  if ((!empty(\devices\Devices::$Options['no_cache'])) && \devices\Devices::$Options['no_cache']) {
                      $global_no_cache = 1;
                  } else {
          Severity: Minor
          Found in core/SanityTests.php - About 1 hr to fix

            Method testPhpModules has 32 lines of code (exceeds 25 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

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

                  public function __construct(int $instId)
                  {
                      $this->databaseType = "INST";
                      parent::__construct(); // now databaseHandle and logging is available
                      $this->entityOptionTable = "institution_option";
              Severity: Minor
              Found in core/IdP.php - About 1 hr to fix

                Method revokeCertificate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function revokeCertificate($serial): void
                    {
                        try {
                            $soap = $this->initEduPKISoapSession("RA");
                            $soapRevocationSerial = $soap->newRevocationRequest(["Serial", $serial], "");
                Severity: Minor
                Found in core/CertificationAuthorityEduPkiServer.php - About 1 hr to fix

                  Method wpaSupplicantConfig has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function wpaSupplicantConfig(array $eaptype, string $inner, string $outer, string $password) {
                          $eapText = \core\common\EAP::eapDisplayName($eaptype);
                          $config = '
                  network={
                    ssid="' . \config\Master::APPEARANCE['productname'] . ' testing"
                  Severity: Minor
                  Found in core/diag/RADIUSTests.php - About 1 hr to fix

                    Method revokeCertificate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function revokeCertificate($serial): void
                        {
                            try {
                                $soap = $this->initEduPKISoapSession("RA");
                                $soapRevocationSerial = $soap->newRevocationRequest(["Serial", $serial], "");
                    Severity: Minor
                    Found in core/CertificationAuthorityEduPki.php - About 1 hr to fix

                      Method significantChanges has 32 lines of code (exceeds 25 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 1 hr to fix

                        Function getDisplayName has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function getDisplayName()
                            {
                                $attr = $this->attributes;
                                $objs = [];
                                if ($this->langScope === 'global') {
                        Severity: Minor
                        Found in devices/eap_config/DeviceXML.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 allNetworkBlocks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function allNetworkBlocks()
                            {
                                $retval = "";
                                $this->serial = 0;
                                $this->loggerInstance->debug(3, $this->attributes['internal:networks'], "NETWORKS:\n", "\n");
                        Severity: Minor
                        Found in devices/apple_mobileconfig/MobileconfigSuperclass.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 networkBlock has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function networkBlock($blocktype, $toBeConfigured, $prettyName)
                            {
                                \core\common\Entity::intoThePotatoes();
                                $eapType = $this->selectedEap;
                                switch ($blocktype) {
                        Severity: Minor
                        Found in devices/apple_mobileconfig/MobileconfigSuperclass.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 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function __construct()
                            {
                                parent::__construct();
                                $this->test_result = [];
                                $this->test_result['global'] = 0;
                        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 downloadStats has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function downloadStats($format, $detail = '')
                            {
                                $data = $this->downloadStatsCore($detail);
                                $retstring = "";
                        
                        
                        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 __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function __construct($invitationId)
                            {
                                parent::__construct();
                                $this->invitationTokenString = $invitationId;
                                $handle = DBConnection::handle("INST");
                        Severity: Minor
                        Found in core/SilverbulletInvitation.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 availableOptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function availableOptions($className = 0)
                            {
                                $tempArray = [];
                                $this->loggerInstance->debug(4, "CLASSNAME IS $className\n");
                        
                        
                        Severity: Minor
                        Found in core/Options.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 setProfileAttributes has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function setProfileAttributes($profile)
                            {
                                $profileOptions = explode('---', $profile->profile_options);
                                $productionProfile = false;
                                $profileNames = [];
                        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 CATInternalTests has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private function CATInternalTests()
                            {
                                // we are expecting to get a REJECT from all runs, because that means the packet got through to the IdP.
                                // (the ETLR sometimes does a "Reject instead of Ignore" but that is filtered out and changed into a timeout
                                // by the test suite automatically, so it does not disturb the measurement)
                        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

                        Severity
                        Category
                        Status
                        Source
                        Language