Showing 529 of 599 total issues

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

Consider simplifying this complex logical expression.
Open

        if ($this->selectedEap == \core\common\EAP::EAPTYPE_TLS || $this->selectedEap == \core\common\EAP::EAPTYPE_PEAP_MSCHAP2 || $this->selectedEap == \core\common\EAP::EAPTYPE_PWD || $this->selectedEap == \core\common\EAP::EAPTYPE_TTLS_PAP || $this->selectedEap == \core\common\EAP::EAPTYPE_TTLS_MSCHAP2 || $this->selectedEap == \core\common\EAP::EAPTYPE_SILVERBULLET) {
            $windowsProfile = [];
            $eapConfig = $this->prepareEapConfig($this->attributes);
            $iterator = 0;
            foreach ($allSSID as $ssid => $cipher) {
Severity: Major
Found in devices/ms/DeviceVista7.php - About 40 mins to fix

    Method sendOptionsToDatabase has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        private function sendOptionsToDatabase($object, array $options, array $pendingattributes, string $device = NULL, int $eaptype = NULL) {
    Severity: Minor
    Found in web/lib/admin/OptionParser.php - About 35 mins to fix

      Method processSubmittedFields has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function processSubmittedFields($object, array $postArray, array $filesArray, int $eaptype = NULL, string $device = NULL) {
      Severity: Minor
      Found in web/lib/admin/OptionParser.php - About 35 mins to fix

        Method processImage has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private function processImage($inputImage, $destFile, $width, $height, $resize)
        Severity: Minor
        Found in core/UserAPI.php - About 35 mins to fix

          Method updateCache has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function updateCache($device, $path, $mime, $integerEapType, $openRoaming)
          Severity: Minor
          Found in core/ProfileRADIUS.php - About 35 mins to fix

            Method updateCache has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function updateCache($device, $path, $mime, $integerEapType, $openRoaming) {
            Severity: Minor
            Found in core/ProfileSilverbullet.php - About 35 mins to fix

              Method newIdP has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function newIdP($type, $ownerId, $level, $mail = NULL, $bestnameguess = NULL)
              Severity: Minor
              Found in core/Federation.php - About 35 mins to fix

                Method addAttributeAllLevels has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    private function addAttributeAllLevels($attrName, $attrLang, $attrValue, $eapType, $device)
                Severity: Minor
                Found in core/ProfileRADIUS.php - About 35 mins to fix

                  Method createCArepository has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

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

                    Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function __construct($realm, $outerUsernameForChecks, $supportedEapTypes = [], $expectedServerNames = [], $expectedCABundle = []) {
                    Severity: Minor
                    Found in core/diag/RADIUSTests.php - About 35 mins to fix

                      Method updateCache has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          abstract public function updateCache($device, $path, $mime, $integerEapType, $openRoaming);
                      Severity: Minor
                      Found in core/AbstractProfile.php - About 35 mins to fix

                        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def __init__(self, silent: bool = False, username: str = '',
                        Severity: Minor
                        Found in devices/linux/Files/main.py - About 35 mins to fix

                          Method opensslClientsResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              private function opensslClientsResult($host, $opensslbabble, &$testresults, $type = '', $resultArrayKey = 0)
                          Severity: Minor
                          Found in core/diag/RFC6614Tests.php - About 35 mins to fix

                            Function innerAuth has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function innerAuth($eap)
                                {
                                    $out = [];
                                    $out['EAP'] = 0;
                                    switch ($eap["INNER"]) {
                            Severity: Minor
                            Found in devices/eap_config/DeviceXML.php - About 35 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 existingFederationInt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function existingFederationInt($input, $owner = NULL)
                                {
                                    $cat = new \core\CAT(); // initialises Entity static members
                                    $fedIdentifiers = array_keys($cat->knownFederations);
                                    if (!in_array(strtoupper($input), $fedIdentifiers)) {
                            Severity: Minor
                            Found in web/lib/common/InputValidation.php - About 35 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 prefilledOptionTable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function prefilledOptionTable(string $attributePrefix, $fed)
                                {
                                    $retval = "<table id='expandable_$attributePrefix" . "_options'>";
                            
                                    $prepopulate = [];
                            Severity: Minor
                            Found in web/lib/admin/OptionDisplay.php - About 35 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 handleMoveEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function handleMoveEvent(evt) {
                                if (this.cursor_) {
                                    var map = evt.map;
                                    var feature = map.forEachFeatureAtPixel(evt.pixel,
                                            basicFeatureHandler,
                            Severity: Minor
                            Found in web/lib/admin/ol_drag.js - About 35 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 getExecPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function getExecPath($pathToCheck)
                                {
                                    $the_path = "";
                                    $exec_is = "UNDEFINED";
                            
                            
                            Severity: Minor
                            Found in core/SanityTests.php - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function __construct($blueprint)
                                {
                                    parent::__construct();
                                    $Dev = \devices\Devices::listDevices();
                                    if (isset($Dev[$blueprint])) {
                            Severity: Minor
                            Found in core/DeviceFactory.php - About 35 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