Showing 529 of 599 total issues

Method uglify has 39 lines of code (exceeds 25 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

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

        public function __construct($fedname)
        {
    
            // initialise the superclass variables
    
    
    Severity: Minor
    Found in core/Federation.php - About 1 hr to fix

      Method relevantNAPTRsrvResolution has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function relevantNAPTRsrvResolution()
          {
      // see if preceding checks have been run, and run them if not
      // compliance check will cascade NAPTR check on its own
              if ($this->NAPTR_compliance_executed == RFC7585Tests::RETVAL_NOTRUNYET) {
      Severity: Minor
      Found in core/diag/RFC7585Tests.php - About 1 hr to fix

        Method relevantNAPTR has 39 lines of code (exceeds 25 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 1 hr to fix

          Method thoroughChainChecks has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function thoroughChainChecks(&$testresults, &$intermOdditiesCAT, $tmpDir, $servercert, $eapIntermediates, $eapIntermediateCRLs) {
          
                  $crlCheckString = $this->createCArepository($tmpDir, $intermOdditiesCAT, $servercert, $eapIntermediates, $eapIntermediateCRLs);
          // ... and run the verification test
                  $verifyResultEaponly = [];
          Severity: Minor
          Found in core/diag/RADIUSTests.php - About 1 hr to fix

            Method authenticate has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function authenticate() {
                    \core\common\Entity::intoThePotatoes();
                    $loggerInstance = new \core\common\Logging();
                    $authSimple = new \SimpleSAML\Auth\Simple(\config\Master::AUTHENTICATION['ssp-authsource']);
                    $authSimple->requireAuth();
            Severity: Minor
            Found in web/lib/admin/Authentication.php - About 1 hr to fix

              Method getExternalDBEntityDetails has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getExternalDBEntityDetails($externalId, $realm = NULL)
                  {
                      $list = [];
                      if (\config\ConfAssistant::CONSORTIUM['name'] == "eduroam" && isset(\config\ConfAssistant::CONSORTIUM['deployment-voodoo']) && \config\ConfAssistant::CONSORTIUM['deployment-voodoo'] == "Operations Team") { // SW: APPROVED
                          $scanforrealm = "";
              Severity: Minor
              Found in core/CAT.php - About 1 hr to fix

                Method writeNsisDefines has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function writeNsisDefines($attr)
                    {
                        $fcontents = '';
                        if ($attr['internal:profile_count'][0] > 1) {
                            $fcontents .= "\n" . '!define USER_GROUP "' . $this->translateString(str_replace('"', '$\\"', $attr['profile:name'][0])) . '"
                Severity: Minor
                Found in devices/ms/WindowsCommon.php - About 1 hr to fix

                  Method setProfileAttributes has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static function setProfileAttributes($profile)
                      {
                          $profileOptions = explode('---', $profile->profile_options);
                          $productionProfile = false;
                          $profileNames = [];
                  Severity: Minor
                  Found in core/IdPlist.php - About 1 hr to fix

                    Method caBlob has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function caBlob($ca)
                        {
                            \core\common\Entity::intoThePotatoes();
                            $stream = "";
                            if (!in_array($ca['uuid'], $this->CAsAccountedFor)) { // skip if this is a duplicate
                    Severity: Minor
                    Found in devices/apple_mobileconfig/MobileconfigSuperclass.php - About 1 hr to fix

                      Method getIdentityProvidersCertStatus has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getIdentityProvidersCertStatus() {
                              $query = "SELECT distinct profile.profile_id  FROM profile JOIN profile_option ON profile.profile_id = profile_option.profile_id WHERE option_name='profile:production' AND profile.sufficient_config = 1";
                              $activeProfiles = [];
                              $result = $this->databaseHandle->exec($query);
                              $rows = $result->fetch_all();
                      Severity: Minor
                      Found in core/Federation.php - About 1 hr to fix

                        Method isDataRestricted has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public static function isDataRestricted($table, $row_id)
                            {
                                if ($table != "institution_option" && $table != "profile_option" && $table != "federation_option" && $table != "user_options") {
                                    return []; // better safe than sorry: that's an error, so assume nobody is authorised to act on that data
                                }
                        Severity: Minor
                        Found in core/EntityWithDBProperties.php - About 1 hr to fix

                          Method propertyCheckServercert has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function propertyCheckServercert(&$servercert) {
                          // we share the same checks as for CAs when it comes to signature algorithm and basicconstraints
                          // so call that function and memorise the outcome
                                  $returnarray = $this->propertyCheckIntermediate($servercert, TRUE);
                                  $sANdns = [];
                          Severity: Minor
                          Found in core/diag/RADIUSTests.php - About 1 hr to fix

                            Function authenticate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function authenticate() {
                                    \core\common\Entity::intoThePotatoes();
                                    $loggerInstance = new \core\common\Logging();
                                    $authSimple = new \SimpleSAML\Auth\Simple(\config\Master::AUTHENTICATION['ssp-authsource']);
                                    $authSimple->requireAuth();
                            Severity: Minor
                            Found in web/lib/admin/Authentication.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 msInfoFile has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function msInfoFile($attr)
                                {
                                    $out = '';
                                    if (isset($attr['support:info_file'])) {
                                        $out .= '!define EXTERNAL_INFO "';
                            Severity: Minor
                            Found in devices/ms/WindowsCommon.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 writeInstaller has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function writeInstaller()
                                {
                                    $this->loggerInstance->debug(4, "Chromebook Installer start\n");
                                    $caRefs = [];
                                    // we don't do per-user encrypted containers
                            Severity: Minor
                            Found in devices/chromebook/DeviceChromebook.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 getBlobFromDB has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function getBlobFromDB($table, $rowindex, $checkpublic) {
                                    // the data is either public (just give it away) or not; in this case, only
                                    // release if the data belongs to admin himself
                                    if ($checkpublic) {
                            
                            
                            Severity: Minor
                            Found in web/lib/admin/UIElements.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 printMenu has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function printMenu($menu = NULL, $id = NULL) {
                                    $menu = $menu ?? $this->menu;
                                    if (count($menu) == 0) {
                                        return;
                                    }
                            Severity: Minor
                            Found in web/skins/modern/Menu.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 generateNewInstaller has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function generateNewInstaller($device, $profile, $generatedFor, $openRoaming, $token, $password)
                                {
                                    $this->loggerInstance->debug(5, "generateNewInstaller() - Enter");
                                    $this->loggerInstance->debug(5, "generateNewInstaller:openRoaming:$openRoaming\n");
                                    $factory = new DeviceFactory($device);
                            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 significantChanges has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function significantChanges($old, $new)
                                {
                                    // check if the name of the inst was changed (in any language)
                                    $retval = [];
                                    $baseline = [];
                            Severity: Minor
                            Found in core/IdP.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

                            Severity
                            Category
                            Status
                            Source
                            Language