Showing 529 of 599 total issues

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

    private function thoroughNameChecks($servercert, &$testresults) {
        // Strategy for checks: we are TOTALLY happy if any one of the
        // configured names shows up in both the CN and a sAN
        // This is the primary check.
        // If that was not the case, we are PARTIALLY happy if any one of
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 printDynamic has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function printDynamic()
    {
        $out = [];
        $out[] = "<div id='dynamic_tests'><fieldset class='option_container'>
            <legend><strong>"._("DYNAMIC connectivity tests")."</strong></legend>";
Severity: Minor
Found in core/diag/RADIUSTestsUI.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 isDataRestricted has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function isDataRestricted($table, $row_id)
    {
        if ($table != "institution_option" && $table != "profile_option" && $table != "federation_option" && $table != "user_options") {
            return []; // better safe than sorry: that's an error, so assume nobody is authorised to act on that data
        }
Severity: Minor
Found in core/EntityWithDBProperties.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($userId)
    {
        $this->databaseType = "USER";
        parent::__construct(); // database handle is now available
        $this->attributes = [];
Severity: Minor
Found in core/User.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 opensslClientsResult has a Cognitive Complexity of 11 (exceeds 5 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

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 checkServerName has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkServerName($host)
    {
        // it could match CN or sAN:DNS, we don't care which
        if (isset($this->TLS_CA_checks_result[$host]['certdata']['subject'])) {
            $this->loggerInstance->debug(4, "Checking expected server name " . $this->expectedName . 
Severity: Minor
Found in core/diag/RFC6614Tests.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 clientP12Block has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function clientP12Block()
    {
        \core\common\Entity::intoThePotatoes();
        if (count($this->clientCert) == 0) {
            throw new Exception("the client block was called but there is no client certificate!");
Severity: Minor
Found in devices/apple_mobileconfig/MobileconfigSuperclass.php - About 1 hr to fix

    Method pngInjectConsortiumLogo has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function pngInjectConsortiumLogo(string $inputpngstring, int $symbolsize, int $marginsymbols = 4) {
            $loggerInstance = new \core\common\Logging();
            $inputgd = imagecreatefromstring($inputpngstring);
            if ($inputgd === FALSE) { // source image is bogus; don't do anything
                return "";
    Severity: Minor
    Found in web/lib/admin/UIElements.php - About 1 hr to fix

      Method instLevelInfoBoxes has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function instLevelInfoBoxes(\core\IdP $myInst) {
              \core\common\Entity::intoThePotatoes();
              $idpoptions = $myInst->getAttributes();
              $retval = "<div class='infobox'>
              <h2>" . sprintf(_("General %s details"), $this->nomenclatureParticipant) . "</h2>
      Severity: Minor
      Found in web/lib/admin/UIElements.php - About 1 hr to fix

        Method getNetworks has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function getNetworks()
            {
                $additionalConsortia = [];
                $additionalSSIDs = [];
                $ssids = $this->getConfigSSIDs();
        Severity: Minor
        Found in core/DeviceConfig.php - About 1 hr to fix

          Method printDynamic has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function printDynamic()
              {
                  $out = [];
                  $out[] = "<div id='dynamic_tests'><fieldset class='option_container'>
                      <legend><strong>"._("DYNAMIC connectivity tests")."</strong></legend>";
          Severity: Minor
          Found in core/diag/RADIUSTestsUI.php - About 1 hr to fix

            Method headerDiv has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function headerDiv($cap1, $language) {
                    \core\common\Entity::intoThePotatoes();
                    $place = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
            
                    $retval = "<div class='header'>
            Severity: Minor
            Found in web/lib/admin/PageDecoration.php - About 1 hr to fix

              Method removenetworkBlock has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function removenetworkBlock($ssid)
                  {
                      \core\common\Entity::intoThePotatoes();
                      $retval = "
              <dict>
              Severity: Minor
              Found in devices/apple_mobileconfig/MobileconfigSuperclass.php - About 1 hr to fix

                Method footer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function footer() {
                        $cat = new \core\CAT();
                        \core\common\Entity::intoThePotatoes();
                        $retval = "</div><!-- thirdrow --></div><!-- trick -->
                          </div><!-- pagecontent -->
                Severity: Minor
                Found in web/lib/admin/PageDecoration.php - About 1 hr to fix

                  Method boxFlexible has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function boxFlexible(int $level, string $text = NULL, string $caption = NULL, bool $omittabletags = FALSE) {
                          \core\common\Entity::intoThePotatoes();
                          $uiMessages = [
                              \core\common\Entity::L_OK => ['img' => 'Tabler/square-rounded-check-filled-green.svg', 'text' => _("OK")],
                              \core\common\Entity::L_REMARK => ['img' => 'Tabler/info-square-rounded-filled-blue.svg', 'text' => _("Remark")],
                  Severity: Minor
                  Found in web/lib/admin/UIElements.php - About 1 hr to fix

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

                      Method getUserAuthRecords has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getUserAuthRecords($userId, $testActivity = false) {
                              // find out all certificate CNs belonging to the user, including expired and revoked ones
                              $userData = $this->userStatus($userId);
                              $certNames = [];
                              foreach ($userData as $oneSlice) {
                      Severity: Minor
                      Found in core/ProfileSilverbullet.php - About 1 hr to fix

                        Method jsonListProfiles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function jsonListProfiles($idpIdentifier, $sort = 0)
                            {
                                $returnArray = [];
                                try {
                                    $idp = new IdP($idpIdentifier);
                        Severity: Minor
                        Found in core/UserNetAPI.php - About 1 hr to fix

                          Method createTemporaryDirectory has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public static function createTemporaryDirectory($purpose = 'installer', $failIsFatal = 1)
                              {
                                  $loggerInstance = new Logging();
                                  $name = md5(time() . rand());
                                  $path = ROOT;
                          Severity: Minor
                          Found in core/common/Entity.php - About 1 hr to fix

                            Method findGoodServerLocation has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function findGoodServerLocation($adminLocation, $federation, $blacklistedServers)
                                {
                                    // find a server near him (list of all servers with capacity, ordered by distance)
                                    // first, if there is a pool of servers specifically for this federation, prefer it
                                    // only check the consortium pool group we want to attach to
                            Severity: Minor
                            Found in core/DeploymentManaged.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language