Showing 503 of 577 total issues

File API.php has 507 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 web/admin/API.php - About 1 day to fix

    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

    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 CAT.php has 479 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 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

            File AbstractProfile.php has 459 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/AbstractProfile.php - About 7 hrs to fix

              File RADIUSTestsUI.php has 457 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/diag/RADIUSTestsUI.php - About 7 hrs to fix

                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

                  Function setGlobalDynamicResult has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function setGlobalDynamicResult()
                      {
                          foreach ($this->allReachabilityResults['capath'] as $capath) {
                              $this->globalLevelDynamic = max($this->globalLevelDynamic, $capath->level);
                          }
                  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 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

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

                        public function __construct()
                        {
                            parent::__construct();
                            // initialise the DB
                            $handle = \core\DBConnection::handle("DIAGNOSTICS");
                    Severity: Major
                    Found in core/diag/AbstractTest.php - About 6 hrs to fix

                      Function writeInstaller has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function writeInstaller()
                          {
                              \core\common\Entity::intoThePotatoes();
                              $rootname = 'EAPIdentityProviderList';
                              $dom = new \DOMDocument('1.0', 'utf-8');
                      Severity: Minor
                      Found in devices/eap_config/DeviceXML.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 DeviceVista7.php has 416 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 devices/ms/DeviceVista7.php - About 6 hrs to fix

                        Function scrub has a Cognitive Complexity of 39 (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']);
                                // 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 5 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 edit_profile.php has 409 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/edit_profile.php - About 5 hrs to fix

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

                          function displayRadiusPropertyWidget(&$theProfile, $readonly, &$uiElements) {
                              ?>
                              <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 5 hrs to fix

                            File API.php has 388 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/API.php - About 5 hrs to fix

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

                              function displayRadiusPropertyWidget(&$theProfile, $readonly, &$uiElements) {
                                  ?>
                                  <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 5 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

                              Severity
                              Category
                              Status
                              Source
                              Language