Showing 529 of 599 total issues

Method generateWlanProfile has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private function generateWlanProfile($networkName, $ssids, $authentication, $encryption, $ois, $hs20 = false)
Severity: Minor
Found in devices/ms/DeviceW8W10.php - About 45 mins to fix

    Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private function __construct($database)
        {
            $this->loggerInstance = new \core\common\Logging();
            $databaseCapitalised = strtoupper($database);
            if (isset(\config\Master::DB[$databaseCapitalised])) {
    Severity: Minor
    Found in core/DBConnection.php - About 45 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

    Method downloadInstaller has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function downloadInstaller($device, $prof_id, $generated_for = 'user', $openRoaming = 0, $token = NULL, $password = NULL)
    Severity: Minor
    Found in core/UserAPI.php - About 45 mins to fix

      Function getInstallerBasename has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private function getInstallerBasename()
          {
              $baseName = $this->customTranslit(\config\ConfAssistant::CONSORTIUM['name'])."-".$this->getDeviceId();
              if (isset($this->attributes['profile:customsuffix'][1])) {
                  // this string will end up as a filename on a filesystem, so always
      Severity: Minor
      Found in core/DeviceConfig.php - About 45 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

      Method writeWLANprofile has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private function writeWLANprofile($wlanProfileName, $ssid, $auth, $encryption, $eapConfig, $profileNumber) {
      Severity: Minor
      Found in devices/ms/DeviceVista7.php - About 45 mins to fix

        Function splitNames has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            private function splitNames($nameRaw) {
                $variants = explode('#', $nameRaw);
                $submatches = [];
                $returnArray = [];
                foreach ($variants as $oneVariant) {
        Severity: Minor
        Found in core/ExternalEduroamDBData.php - About 45 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 __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct($profileId, $idpObject = NULL)
            {
                parent::__construct($profileId, $idpObject);
        
                $this->entityOptionTable = "profile_option";
        Severity: Minor
        Found in core/ProfileRADIUS.php - About 45 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

        Method generateNewInstaller has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private function generateNewInstaller($device, $profile, $generatedFor, $openRoaming, $token, $password)
        Severity: Minor
        Found in core/UserAPI.php - About 45 mins to fix

          Function link has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function link()
              {
                  if (isset($_SERVER['HTTPS'])) {
                      $link = 'https://';
                  } else {
          Severity: Minor
          Found in core/SilverbulletInvitation.php - About 45 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 jsonListDevices has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function jsonListDevices($profileId)
              {
                  $returnArray = [];
                  $profileAttributes = $this->profileAttributes($profileId);
                  $thedevices = $profileAttributes['devices'];
          Severity: Minor
          Found in core/UserNetAPI.php - About 45 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 __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct()
              {
                  $this->databaseType = "INST";
                  parent::__construct();
                  $this->rootPem = file_get_contents(CertificationAuthorityEmbeddedECDSA::LOCATION_ROOT_CA);
          Severity: Minor
          Found in core/CertificationAuthorityEmbeddedECDSA.php - About 45 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 saveCertificateFiles has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              final protected function saveCertificateFiles($format)
              {
                  switch ($format) {
                      case "der": // fall-thorugh, same treatment
                      case "pem":
          Severity: Minor
          Found in core/DeviceConfig.php - About 45 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

          Method adminInvitationMail has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function adminInvitationMail($targets, $introtext, $newtoken, $idpPrettyName, $federation, $type)
          Severity: Minor
          Found in core/common/OutsideComm.php - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ($ch === FALSE) {
                                            $loggerInstance->debug(2, "Unable ask eduGAIN about IdP - CURL init failed!");
                                            break;
                                        }
            Severity: Major
            Found in core/User.php - About 45 mins to fix

              Method marshalObject has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public static function marshalObject($domElement, $node, $name, $object, $namespace = NULL, $root = false)
              Severity: Minor
              Found in core/DeviceXMLmain.php - About 45 mins to fix

                Method createTokens has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function createTokens($isByFedadmin, $for, $instIdentifier, $externalId = 0, $country = 0, $partType = 0)
                Severity: Minor
                Found in core/UserManagement.php - About 45 mins to fix

                  Function printDN has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function printDN($distinguishedName) {
                          $out = '';
                          foreach (array_reverse($distinguishedName) as $nameType => $nameValue) { // to give an example: "CN" => "some.host.example" 
                              if (!is_array($nameValue)) { // single-valued: just a string
                                  $nameValue = ["$nameValue"]; // convert it to a multi-value attrib with just one value :-) for unified processing later on
                  Severity: Minor
                  Found in core/diag/RADIUSTests.php - About 45 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 createTemporaryDirectory has a Cognitive Complexity of 8 (exceeds 5 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 45 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

                  Method thoroughChainChecks has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private function thoroughChainChecks(&$testresults, &$intermOdditiesCAT, $tmpDir, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
                  Severity: Minor
                  Found in core/diag/RADIUSTests.php - About 45 mins to fix

                    Function detect_desktop_environment has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def detect_desktop_environment() -> str:
                        """
                        Detect what desktop type is used. This method is prepared for
                        possible future use with password encryption on supported distros
                    
                    
                    Severity: Minor
                    Found in devices/linux/Files/main.py - About 45 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