Showing 529 of 599 total issues

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

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

        public function __construct($profileIdRaw, $idpObject = NULL)
        {
            $this->databaseType = "INST";
            parent::__construct(); // we now have access to our INST database handle and logging
            $handle = DBConnection::handle("FRONTEND");
    Severity: Minor
    Found in core/AbstractProfile.php - About 1 hr to fix

      Method existingIdPInt has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function existingIdPInt($input, $owner = NULL, $claimedFedBinding = NULL)
          {
              $clean = $this->integer($input);
              if ($clean === FALSE) {
                  throw new Exception($this->inputValidationError("Value for IdP is not an integer!"));
      Severity: Minor
      Found in web/lib/common/InputValidation.php - About 1 hr to fix

        Method printMenu has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function printMenu($menu = NULL, $id = NULL) {
                $menu = $menu ?? $this->menu;
                if (count($menu) == 0) {
                    return;
                }
        Severity: Minor
        Found in web/skins/modern/Menu.php - About 1 hr to fix

          Method writeDeviceInfo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function writeDeviceInfo()
              {
                  \core\common\Entity::intoThePotatoes();
                  $networkList = [];
                  foreach (array_keys($this->getAttribute('internal:networks')) as $networkName) {
          Severity: Minor
          Found in devices/ms/WindowsCommon.php - About 1 hr to fix

            Method defaultPagePrelude has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function defaultPagePrelude($pagetitle = \config\Master::APPEARANCE['productname_long']) {
                    $ourlocale = $this->languageInstance->getLang();
                    $direction = $this->languageInstance->rtl;
                    header("Content-Type:text/html;charset=utf-8");
                    ?>
            Severity: Minor
            Found in web/lib/user/Gui.php - About 1 hr to fix

              Method handle has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function handle($database)
                  {
                      $theDb = strtoupper($database);
                      switch ($theDb) {
                          case "INST":
              Severity: Minor
              Found in core/DBConnection.php - About 1 hr to fix

                Method revaluate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function revaluate($questionNumber, $answer)
                    {
                        if ($questionNumber == "") {
                            throw new Exception("We really need a question number!");
                        }
                Severity: Minor
                Found in core/diag/Sociopath.php - About 1 hr to fix

                  Method generateCompatibleCsr has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function generateCompatibleCsr($privateKey, $fed, $username): array
                      {
                          $tempdirArray = \core\common\Entity::createTemporaryDirectory("test");
                          $tempdir = $tempdirArray['dir'];
                          // dump private key into directory
                  Severity: Minor
                  Found in core/CertificationAuthorityEduPkiServer.php - About 1 hr to fix

                    Method checkFedEtlrUplink has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function checkFedEtlrUplink($whichSide)
                        {
                            // TODO: we always check the European TLRs even though the connection in question might go via others and/or this one
                            // needs a table to determine what goes where :-(
                            switch ($whichSide) {
                    Severity: Minor
                    Found in core/diag/Telepath.php - About 1 hr to fix

                      Method generateCompatibleCsr has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function generateCompatibleCsr($privateKey, $fed, $username): array
                          {
                              $tempdirArray = \core\common\Entity::createTemporaryDirectory("test");
                              $tempdir = $tempdirArray['dir'];
                              // dump private key into directory
                      Severity: Minor
                      Found in core/CertificationAuthorityEduPki.php - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if ($this->idPFederation !== NULL &&
                                        $this->visitedFlr !== NULL &&
                                        !array_key_exists(AbstractTest::INFRA_ETLR, $this->possibleFailureReasons) &&
                                        !array_key_exists(AbstractTest::INFRA_LINK_ETLR_NRO_IDP, $this->possibleFailureReasons) &&
                                        !array_key_exists(AbstractTest::INFRA_NRO_IDP, $this->possibleFailureReasons) &&
                        Severity: Major
                        Found in core/diag/Telepath.php - About 1 hr to fix

                          Method executeEapolTest has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              private function executeEapolTest($tmpDir, $probeindex, $eaptype, $outerUser, $innerUser, $password, $opnameCheck, $frag) {
                          Severity: Major
                          Found in core/diag/RADIUSTests.php - About 1 hr to fix

                            Function sanityTestResultHTML has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function sanityTestResultHTML($test) {
                                    $out = '';
                                    switch ($test->test_result['global']) {
                                        case \core\common\Entity::L_OK:
                                            $message = "Your configuration appears to be fine.";
                            Severity: Minor
                            Found in web/lib/admin/UIElements.php - About 55 mins 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 eapBlock has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function eapBlock($caRefs)
                                {
                                    $selectedEap = $this->selectedEap;
                                    $outerId = $this->determineOuterIdString();
                                    $eapPrettyprint = \core\common\EAP::eapDisplayName($selectedEap);
                            Severity: Minor
                            Found in devices/chromebook/DeviceChromebook.php - About 55 mins 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 runTests has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function runTests($Tests)
                                {
                                    foreach ($Tests as $testName) {
                                        $matchArray = [];
                                        if (preg_match('/(.+)=>(.+)/', $testName, $matchArray)) {
                            Severity: Minor
                            Found in core/SanityTests.php - About 55 mins 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 triggerNewOCSPStatement has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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 detectOS has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function detectOS()
                                {
                                    $Dev = \devices\Devices::listDevices();
                                    $devId = $this->deviceFromRequest();
                                    if ($devId !== NULL) {
                            Severity: Minor
                            Found in core/UserAPI.php - About 55 mins 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 getSSIDs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function getSSIDs()
                                {
                                    $ssidList = [];
                                    $ssidList['add'] = [];
                                    $ssidList['del'] = [];
                            Severity: Minor
                            Found in core/DeviceConfig.php - About 55 mins 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 triggerNewOCSPStatement has a Cognitive Complexity of 9 (exceeds 5 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 55 mins 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