Showing 529 of 599 total issues

Function udpLogin has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function udpLogin($probeindex, $eaptype, $innerUser, $password, $opnameCheck = TRUE, $frag = TRUE, $clientcertdata = NULL) {
        $preliminaries = $this->udpLoginPreliminaries($probeindex, $eaptype, $clientcertdata);
        if ($preliminaries !== TRUE) {
            return $preliminaries;
        }
Severity: Minor
Found in core/diag/RADIUSTests.php - About 2 hrs 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 __get_p12_cred has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    def __get_p12_cred(self):
        """get the password for the PFX file"""
        if Config.eap_inner == 'SILVERBULLET':
            self.__save_sb_pfx()
        else:
Severity: Minor
Found in devices/linux/Files/main.py - About 2 hrs 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 isEapTypeDefinitionComplete has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function isEapTypeDefinitionComplete($eaptype)
    {
        if ($eaptype->needsServerCACert() && $eaptype->needsServerName()) {
            $missing = [];
            // silverbullet needs a support email address configured
Severity: Minor
Found in core/AbstractProfile.php - About 2 hrs 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 setup has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    final public function setup(AbstractProfile $profile, $token = NULL, $importPassword = NULL, $openRoaming = 0)
    {
        $this->loggerInstance->debug(4, "module setup start\n");
        common\Entity::intoThePotatoes();
        $purpose = 'installer';
Severity: Major
Found in core/DeviceConfig.php - About 2 hrs to fix

    Method extractIncomingCertsfromEAP has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function extractIncomingCertsfromEAP(&$testresults, $tmpDir) {
            /*
             *  EAP's house rules:
             * 1) it is unnecessary to include the root CA itself (adding it has
             *    detrimental effects on performance)
    Severity: Major
    Found in core/diag/RADIUSTests.php - About 2 hrs to fix

      File overview_sp.php has 271 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*
       * *****************************************************************************
       * Contributions to this work were made on behalf of the GÉANT project, a 
       * project that has received funding from the European Union’s Framework 
      Severity: Minor
      Found in web/admin/overview_sp.php - About 2 hrs to fix

        Method infoblock has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function infoblock(array $optionlist, string $class, string $level) {
                \core\common\Entity::intoThePotatoes();
                $locationMarkers = [];
                $retval = "";
                $optioninfo = \core\Options::instance();
        Severity: Major
        Found in web/lib/admin/UIElements.php - About 2 hrs to fix

          Function getExternalDBSyncCandidates has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getExternalDBSyncCandidates($type)
              {
                  $usedarray = [];
                  $matchingCandidates = [];
                  $syncstate = self::EXTERNAL_DB_SYNCSTATE_SYNCED;
          Severity: Minor
          Found in core/IdP.php - About 2 hrs 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 18 (exceeds 5 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 2 hrs 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 weNeedToTalk has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              public function weNeedToTalk() {
                  $this->determineMailsToSend();
                  foreach ($this->mailQueue as $oneMail) {
                      $theMail = $this->mailStack[$oneMail];
                      // if user interaction would have been good, but the user didn't 
          Severity: Minor
          Found in core/diag/Logopath.php - About 2 hrs 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 autodetectCAWithProbe has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              public function autodetectCAWithProbe($outerId) {
                  // for EAP-TLS to be a viable option, we need to pass a random client cert to make eapol_test happy
                  // the following PEM data is one of the SENSE EAPLab client certs (not secret at all)
                  $clientcert = file_get_contents(dirname(__FILE__) . "/clientcert.p12");
                  if ($clientcert === FALSE) {
          Severity: Minor
          Found in core/diag/RADIUSTests.php - About 2 hrs 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 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function __construct($token)
              {
                  parent::__construct();
                  $this->globalInfo = [
                      \core\common\Entity::L_OK => _("All tests passed."),
          Severity: Major
          Found in core/diag/RADIUSTestsUI.php - About 2 hrs to fix

            Method previewCAinHTML has 59 lines of code (exceeds 25 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: Major
            Found in web/lib/admin/UIElements.php - About 2 hrs to fix

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

                  public function __construct($invitationId)
                  {
                      parent::__construct();
                      $this->invitationTokenString = $invitationId;
                      $handle = DBConnection::handle("INST");
              Severity: Major
              Found in core/SilverbulletInvitation.php - About 2 hrs to fix

                Method exec has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function exec($querystring, $types = NULL, &...$arguments)
                    {
                        // log exact query to audit log, if it's not a SELECT
                        $isMoreThanSelect = FALSE;
                        if (preg_match("/^(SELECT\ |SET\ )/i", $querystring) == 0 && preg_match("/^DESC/i", $querystring) == 0) {
                Severity: Major
                Found in core/DBConnection.php - About 2 hrs to fix

                  Method writeConfigVars has 59 lines of code (exceeds 25 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: Major
                  Found in devices/linux/DeviceLinuxSh.php - About 2 hrs to fix

                    Method testGeoip has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function testGeoip()
                        {
                            $host_4 = '145.0.2.50';
                            $host_6 = '2001:610:188:444::50';
                            switch (\config\Master::GEOIP['version']) {
                    Severity: Major
                    Found in core/SanityTests.php - About 2 hrs to fix

                      DeviceXML has 22 functions (exceeds 20 allowed). Consider refactoring.
                      Open

                      abstract class DeviceXML extends \core\DeviceConfig
                      {
                          
                          /**
                           *  @var array $AuthMethodElements is used to limit
                      Severity: Minor
                      Found in devices/eap_config/DeviceXML.php - About 2 hrs to fix

                        UIElements has 22 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        class UIElements extends \core\common\Entity {
                        
                            /**
                             * the custom displayable variant of the term 'federation'
                             * 
                        Severity: Minor
                        Found in web/lib/admin/UIElements.php - About 2 hrs to fix

                          UserAPI has 22 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          class UserAPI extends CAT
                          {
                          
                              /**
                               * nothing special to be done here.
                          Severity: Minor
                          Found in core/UserAPI.php - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language