Showing 529 of 599 total issues

File MobileconfigSuperclass.php has 531 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

/*
 * *****************************************************************************
 * Contributions to this work were made on behalf of the GÉANT project, a 
Severity: Major
Found in devices/apple_mobileconfig/MobileconfigSuperclass.php - About 1 day to fix

    File Devices-template.php has 530 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
     * *****************************************************************************
     * Contributions to this work were made on behalf of the GÉANT project, a 
    Severity: Major
    Found in devices/Devices-template.php - About 1 day to fix

      Function displayDeploymentPropertyWidget has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
      Open

      function displayDeploymentPropertyWidget(&$deploymentObject) {
          // RADIUS status icons
          $radiusMessages = [
              \core\AbstractDeployment::RADIUS_OK => ['icon' => '../resources/images/icons/Tabler/square-rounded-check-filled-green.svg', 'text' => _("Successfully set profile")],
              \core\AbstractDeployment::RADIUS_FAILURE => ['icon' => '../resources/images/icons/Tabler/square-rounded-x-filled-red.svg', 'text' => _("Some problem occurred during profile update")],
      Severity: Minor
      Found in web/admin/overview_org.php - About 1 day 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 prepareEapConfig has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
      Open

          private function prepareEapConfig($attr)
          {
              $outerUser = '';
              $vistaExt = '';
              $w7Ext = '';
      Severity: Minor
      Found in devices/ms/DeviceVista7.php - About 1 day 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

      File RADIUSTestsUI.php has 511 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      /*
       * *****************************************************************************
       * Contributions to this work were made on behalf of the GÉANT project, a 
      Severity: Major
      Found in core/diag/RADIUSTestsUI.php - About 1 day to fix

        Function prompt_nonempty_string has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
        Open

            def prompt_nonempty_string(self, show: int, prompt: str, val: str = '') -> str:
                """
                Prompt user for input
                """
                if self.graphics == 'tty':
        Severity: Minor
        Found in devices/linux/Files/main.py - About 1 day 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 sanitiseInputs has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring.
        Open

            private function sanitiseInputs(array $listOfEntries) {
                $retval = [];
                $bad = [];
                $multilangAttrsWithC = [];
                foreach ($listOfEntries as $objId => $objValueRaw) {
        Severity: Minor
        Found in web/lib/admin/OptionParser.php - About 1 day 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 marshalObject has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function marshalObject($domElement, $node, $name, $object, $namespace = NULL, $root = false)
            {
                if (is_null($object)) {
                    return;
                }
        Severity: Minor
        Found in core/DeviceXMLmain.php - About 7 hrs 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

        File CAT.php has 489 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        /*
         * *****************************************************************************
         * Contributions to this work were made on behalf of the GÉANT project, a 
        Severity: Minor
        Found in core/CAT.php - About 7 hrs to fix

          Method prepareEapConfig has 193 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function prepareEapConfig($attr)
              {
                  $outerUser = '';
                  $vistaExt = '';
                  $w7Ext = '';
          Severity: Major
          Found in devices/ms/DeviceVista7.php - About 7 hrs to fix

            File diag_js.php has 483 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            /*
             * *****************************************************************************
             * Contributions to this work were made on behalf of the GÉANT project, a 
            Severity: Minor
            Found in web/skins/modern/diag/js/diag_js.php - About 7 hrs to fix

              File overview_federation.php has 475 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              /*
               * *****************************************************************************
               * Contributions to this work were made on behalf of the GÉANT project, a 
               * project that has received funding from the European Union’s Framework 
              Severity: Minor
              Found in web/admin/overview_federation.php - About 7 hrs to fix

                Method htmlHeadCode has 179 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function htmlHeadCode() {
                        $cat = new \core\CAT();
                        \core\common\Entity::intoThePotatoes();
                        $retval = "
                        <link href='../external/OpenLayers/ol.css' rel='stylesheet' type='text/css'>
                Severity: Major
                Found in web/lib/admin/MapOpenLayers.php - About 7 hrs to fix

                  Function scrub has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function scrub($inputJson, $fedObject) {        
                          $optionInstance = \core\Options::instance();
                          $parameters = [];
                          $allPossibleAttribs = array_merge(API::ACTIONS[$inputJson['ACTION']]['REQ'], API::ACTIONS[$inputJson['ACTION']]['OPT'],  API::ACTIONS[$inputJson['ACTION']]['FLAG']);
                          // some actions don't need parameters. Don't get excited when there aren't any.
                  Severity: Minor
                  Found in web/lib/admin/API.php - About 6 hrs 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

                  File DeviceXML.php has 454 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  /*
                   * *****************************************************************************
                   * Contributions to this work were made on behalf of the GÉANT project, a 
                  Severity: Minor
                  Found in devices/eap_config/DeviceXML.php - About 6 hrs to fix

                    Method displayRadiusPropertyWidget has 172 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function displayRadiusPropertyWidget(&$theProfile, $readonly, &$uiElements, $editMode) {
                        ?>
                        <div style='padding-bottom:20px;'>
                            <?php $profile_name = $theProfile->name; ?>
                            <div style='margin-bottom:10px; display:block;'>
                    Severity: Major
                    Found in web/admin/overview_org.php - About 6 hrs to fix

                      Function displayRadiusPropertyWidget has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function displayRadiusPropertyWidget(&$theProfile, $readonly, &$uiElements, $editMode) {
                          ?>
                          <div style='padding-bottom:20px;'>
                              <?php $profile_name = $theProfile->name; ?>
                              <div style='margin-bottom:10px; display:block;'>
                      Severity: Minor
                      Found in web/admin/overview_org.php - About 6 hrs 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 collectCAPath has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function collectCAPath()
                          {
                              $capathtest = [];
                              $capathtest[] = '<p><strong>'._("Checking server handshake...")."</strong><p>";
                              $allfailed = TRUE;
                      Severity: Minor
                      Found in core/diag/RADIUSTestsUI.php - About 6 hrs 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

                      File UIElements.php has 439 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      /*
                       * *****************************************************************************
                       * Contributions to this work were made on behalf of the GÉANT project, a 
                      Severity: Minor
                      Found in web/lib/admin/UIElements.php - About 6 hrs to fix

                        File DeviceConfig.php has 436 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        <?php
                        
                        /*
                         * *****************************************************************************
                         * Contributions to this work were made on behalf of the GÉANT project, a 
                        Severity: Minor
                        Found in core/DeviceConfig.php - About 6 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language