Showing 599 of 599 total issues

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

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

                    public function getUserDownloadStats($device = NULL)
                    {
                        $columnName = "downloads_user";
                        if ($this instanceof \core\ProfileSilverbullet) {
                            $columnName = "downloads_silverbullet";
                Severity: Minor
                Found in core/AbstractProfile.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

                Similar blocks of code found in 9 locations. Consider refactoring.
                Open

                            'android_nougat' => [
                                'group' => "android",
                                'display' => _("Android 7.0 Nougat"),
                                'match' => 'Android 7',
                                'directory' => 'eap_config',
                Severity: Major
                Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
                devices/Devices-template.php on lines 457..470
                devices/Devices-template.php on lines 501..514
                devices/Devices-template.php on lines 515..528
                devices/Devices-template.php on lines 529..542
                devices/Devices-template.php on lines 557..570
                devices/Devices-template.php on lines 571..584
                devices/Devices-template.php on lines 585..598
                devices/Devices-template.php on lines 599..612

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 94.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 9 locations. Consider refactoring.
                Open

                            'android_kitkat' => [
                                'group' => "android",
                                'display' => _("Android 4.4 KitKat"),
                                'match' => 'Android 4\.[4-9]',
                                'directory' => 'eap_config',
                Severity: Major
                Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
                devices/Devices-template.php on lines 457..470
                devices/Devices-template.php on lines 501..514
                devices/Devices-template.php on lines 515..528
                devices/Devices-template.php on lines 529..542
                devices/Devices-template.php on lines 543..556
                devices/Devices-template.php on lines 557..570
                devices/Devices-template.php on lines 571..584
                devices/Devices-template.php on lines 599..612

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 94.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 9 locations. Consider refactoring.
                Open

                            'android_8_10' => [
                                'group' => "android",
                                'display' => _("Android 8 to 10"),
                                'match' => 'Android ([89]|10)',
                                'directory' => 'eap_config',
                Severity: Major
                Found in devices/Devices-template.php and 8 other locations - About 40 mins to fix
                devices/Devices-template.php on lines 501..514
                devices/Devices-template.php on lines 515..528
                devices/Devices-template.php on lines 529..542
                devices/Devices-template.php on lines 543..556
                devices/Devices-template.php on lines 557..570
                devices/Devices-template.php on lines 571..584
                devices/Devices-template.php on lines 585..598
                devices/Devices-template.php on lines 599..612

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 94.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Severity
                Category
                Status
                Source
                Language