Showing 529 of 599 total issues

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

    public function __construct($listOfIPs, $expectedName, $consortium = "eduroam")
    {
        parent::__construct();
        \core\common\Entity::intoThePotatoes();
        $this->TLS_certkeys = [
Severity: Minor
Found in core/diag/RFC6614Tests.php - About 1 hr to fix

    Function uglify has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function uglify($parameters) {
            $coercedInline = [];
            $coercedFile = [];
            $optionObject = \core\Options::instance();
            $dir = \core\common\Entity::createTemporaryDirectory('test');
    Severity: Minor
    Found in web/lib/admin/API.php - About 1 hr 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 getWindowHeight has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    function getWindowHeight() {
        var windowHeight = 0;
        if (typeof (window.innerHeight) === 'number') {
            windowHeight = window.innerHeight;
        } else {
    Severity: Minor
    Found in web/admin/js/popup_redirect.js - About 1 hr 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 findResourceUrl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function findResourceUrl($resourcetype, $filename, $submodule = '') {
            switch ($resourcetype) {
                case "CSS":
                    $path = "/resources/css/";
                    break;
    Severity: Minor
    Found in web/lib/user/Skinjob.php - About 1 hr 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 testNSISmodules has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        private function testNSISmodules()
        {
            $tmp_dir = \core\common\Entity::createTemporaryDirectory('installer', 0)['dir'];
            if (!chdir($tmp_dir)) {
                $this->loggerInstance->debug(2, "Cannot chdir to $tmp_dir\n");
    Severity: Minor
    Found in core/SanityTests.php - About 1 hr 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 getLogo has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function getLogo($identifier, $type, $widthIn, $heightIn)
        {
            $expiresString = '';
            $attributeName = [
                'federation' => "fed:logo_file",
    Severity: Minor
    Found in core/UserAPI.php - About 1 hr 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 listDevices has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function listDevices($showHidden = 0)
        {
            $returnList = [];
            $count = 0;
            if ($showHidden !== 0 && $showHidden != 1) {
    Severity: Minor
    Found in core/UserAPI.php - About 1 hr 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 sendSMS has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function sendSMS($number, $content)
        {
            $loggerInstance = new \core\common\Logging();
            switch (\config\ConfAssistant::SMSSETTINGS['provider']) {
                case 'Nexmo':
    Severity: Minor
    Found in core/common/OutsideComm.php - About 1 hr 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 propertyCheckIntermediate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        private function propertyCheckIntermediate(&$intermediateCa, $serverCert = FALSE) {
            $returnarray = [];
            if (preg_match("/md5/i", $intermediateCa['full_details']['signatureTypeSN'])) {
                $returnarray[] = RADIUSTests::CERTPROB_MD5_SIGNATURE;
            }
    Severity: Minor
    Found in core/diag/RADIUSTests.php - About 1 hr 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 sendMailtoAdmin has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        private function sendMailtoAdmin($remove, $response, $status)
        {
            $txt = '';
            if ($status == 'OK') {
                $txt = $remove ? _('Profile deactivation succeeded') : _('Profile activation/modification succeeded');
    Severity: Minor
    Found in core/DeploymentManaged.php - About 1 hr 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 findResourceUrl has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function findResourceUrl($resourcetype, $filename, $submodule = '') {
            switch ($resourcetype) {
                case "CSS":
                    $path = "/resources/css/";
                    break;
    Severity: Minor
    Found in web/lib/user/Skinjob.php - About 1 hr to fix

      Method realm has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function realm($input)
          {
              \core\common\Entity::intoThePotatoes();
              if (strlen($input) == 0) {
                  echo $this->inputValidationError(_("Realm is empty!"));
      Severity: Minor
      Found in web/lib/common/InputValidation.php - About 1 hr to fix

        Method sanityTestResultHTML has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function sanityTestResultHTML($test) {
                $out = '';
                switch ($test->test_result['global']) {
                    case \core\common\Entity::L_OK:
                        $message = "Your configuration appears to be fine.";
        Severity: Minor
        Found in web/lib/admin/UIElements.php - About 1 hr to fix

          Method writeDeviceInfo has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function writeDeviceInfo()
              {
                  \core\common\Entity::intoThePotatoes();
                  $ssidCount = 0;
                  $oiCount = 0;
          Severity: Minor
          Found in devices/apple_mobileconfig/MobileconfigSuperclass.php - About 1 hr to fix

            Method writeMainNSH has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function writeMainNSH($eap, $attr) {
                    $this->loggerInstance->debug(4, "writeMainNSH");
                    $this->loggerInstance->debug(4, $attr);
                    $this->loggerInstance->debug(4, "MYLANG=" . $this->lang . "\n");
            
            
            Severity: Minor
            Found in devices/ms/DeviceVista7.php - About 1 hr to fix

              Method getExternalDBSyncCandidates has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getExternalDBSyncCandidates($type)
                  {
                      $usedarray = [];
                      $matchingCandidates = [];
                      $syncstate = self::EXTERNAL_DB_SYNCSTATE_SYNCED;
              Severity: Minor
              Found in core/IdP.php - About 1 hr to fix

                Method testNSISmodules has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function testNSISmodules()
                    {
                        $tmp_dir = \core\common\Entity::createTemporaryDirectory('installer', 0)['dir'];
                        if (!chdir($tmp_dir)) {
                            $this->loggerInstance->debug(2, "Cannot chdir to $tmp_dir\n");
                Severity: Minor
                Found in core/SanityTests.php - About 1 hr to fix

                  Method initialise has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function initialise()
                      {
                          // find out where the admin is located approximately
                          $ourLocation = ['lon' => 0, 'lat' => 0];
                          $geoip = DeviceLocation::locateDevice();
                  Severity: Minor
                  Found in core/DeploymentManaged.php - About 1 hr to fix

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

                        public function __construct()
                        {
                            $this->loggerInstance = new Logging();
                            $this->loggerInstance->debug(4, "--- BEGIN constructing class " . get_class($this) . " .\n");
                            $this->languageInstance = new Language();
                    Severity: Minor
                    Found in core/common/Entity.php - About 1 hr to fix

                      Method sendToRADIUS has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function sendToRADIUS(int $idx, $post)
                          {
                      
                              $hostname = "radius_hostname_$idx";
                              $ch = curl_init("http://" . $this->$hostname);
                      Severity: Minor
                      Found in core/DeploymentManaged.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language