Showing 529 of 599 total issues

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

    protected function levelPrecedenceAttributeJoin($existing, $new, $newlevel)
    {
        foreach ($new as $attrib) {
            $ignore = "";
            foreach ($existing as $approvedAttrib) {
Severity: Minor
Found in core/EntityWithDBProperties.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 relevantNAPTR has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function relevantNAPTR()
    {
        if ($this->discoveryTag == "") {
            $this->NAPTR_executed = RADIUSTests::RETVAL_NOTCONFIGURED;
            return RADIUSTests::RETVAL_NOTCONFIGURED;
Severity: Minor
Found in core/diag/RFC7585Tests.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 alert has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def alert(self, text: str) -> None:
        """Generate alert message"""
        if self.silent:
            return
        if self.graphics == 'tty':
Severity: Minor
Found in devices/linux/Files/main.py - 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 readyForShowtime has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function readyForShowtime()
    {
        $properConfig = FALSE;
        $attribs = $this->getCollapsedAttributes();
        // do we have enough to go live? Check if any of the configured EAP methods is completely configured ...
Severity: Minor
Found in core/AbstractProfile.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 show_info has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def show_info(self, data: str) -> None:
        """
        Show a piece of information
        """
        if self.silent:
Severity: Minor
Found in devices/linux/Files/main.py - 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 incrementDownloadStats has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function incrementDownloadStats($device, $area, $openRoaming)
    {
        if ($area == "admin" || $area == "user" || $area == "silverbullet") {
            $lang = $this->languageInstance->getLang();
            $this->frontendHandle->exec("INSERT INTO downloads (profile_id, device_id, lang, openroaming, downloads_$area) VALUES (? ,?, ?, ?, 1) ON DUPLICATE KEY UPDATE downloads_$area = downloads_$area + 1", "issi", $this->identifier, $device, $lang, $openRoaming);
Severity: Minor
Found in core/AbstractProfile.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

Method udpLogin has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function udpLogin($probeindex, $eaptype, $innerUser, $password, $opnameCheck = TRUE, $frag = TRUE, $clientcertdata = NULL) {
Severity: Major
Found in core/diag/RADIUSTests.php - About 50 mins to fix

    Method saveDownloadDetails has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function saveDownloadDetails($idpIdentifier, $profileId, $deviceId, $area, $lang, $eapType, $openRoaming)
    Severity: Major
    Found in core/AbstractProfile.php - About 50 mins to fix

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

          public function divOtherinstallers() {
              $retval = "
      <div class='sub_h'>
          <div id='other_installers'>".$this->Gui->textTemplates->templates[user\DOWNLOAD_CHOOSE]."
              <table id='device_list' style='padding:0px;'>";
      Severity: Minor
      Found in web/skins/modern/Divs.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 string has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function string($input, $allowWhitespace = FALSE)
          {
              // always chop out invalid characters, and surrounding whitespace
              $retvalStep0 = iconv("UTF-8", "UTF-8//TRANSLIT", $input);
              if ($retvalStep0 === FALSE) {
      Severity: Minor
      Found in web/lib/common/InputValidation.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

      Avoid deeply nested control flow statements.
      Open

                          if ($oneLine === FALSE) {
                              break;
                          }
      Severity: Major
      Found in web/admin/edit_silverbullet.php - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            if ($number === FALSE) { // invalid input received, default to sane
                                $number = 5;
                            }
        Severity: Major
        Found in web/admin/edit_silverbullet.php - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if ($retval["SENT"]) {
                                      $additionalInfo["EMAIL TRANSPORT SECURE"] = $retval["TRANSPORT"];
                                  }
          Severity: Major
          Found in web/admin/API.php - About 45 mins to fix

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

                private function selectElement($rowid, $list)
                {
                    $jsmagic = "onchange='
                                           if (/#ML#/.test(document.getElementById(\"option-S" . $rowid . "-select\").value)) {
                                               document.getElementById(\"S$rowid-input-langselect\").style.display = \"block\";
            Severity: Minor
            Found in web/lib/admin/OptionDisplay.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 consentBlock has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function consentBlock()
                {
                    \core\common\Entity::intoThePotatoes();
                    if (isset($this->attributes['support:info_file'])) {
                        return MobileconfigSuperclass::BUFFER_CONSENT_PRE . htmlspecialchars(iconv("UTF-8", "UTF-8//TRANSLIT", $this->attributes['support:info_file'][0]), ENT_XML1, 'UTF-8') . MobileconfigSuperclass::BUFFER_CONSENT_POST;
            Severity: Minor
            Found in devices/apple_mobileconfig/MobileconfigSuperclass.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

            Avoid deeply nested control flow statements.
            Open

                                if (count($elements) < 2) {
                                    break;
                                }
            Severity: Major
            Found in web/admin/edit_silverbullet.php - About 45 mins to fix

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

                  protected function combineLogo($logos = NULL, $fedLogo = NULL)
                  {
                      // maximum size to which we want to resize the logos
              
                      $maxSize = 120;
              Severity: Minor
              Found in devices/ms/WindowsCommon.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 getAuthMethodsList has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function getAuthMethodsList() {
                      $methodList = [];
                      if ($this->allEaps) {
                          $eapmethods = [];
                          foreach ($this->attributes['all_eaps'] as $eap) {
              Severity: Minor
              Found in devices/eap_config/DeviceXML.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(CertificationAuthorityEmbeddedRSA::LOCATION_ROOT_CA);
              Severity: Minor
              Found in core/CertificationAuthorityEmbeddedRSA.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 generateInstaller has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function generateInstaller($device, $profileId, $generatedFor = "user", $openRoaming = 0, $token = NULL, $password = NULL)
              Severity: Minor
              Found in core/UserAPI.php - About 45 mins to fix
                Severity
                Category
                Status
                Source
                Language