XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function renderOutput has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function renderOutput($page_title = 'PHP Security Information')
    {
        /**
         * We need to use PhpSecInfo_Test::getBooleanIniValue() below
         *
Severity: Minor
Found in phpsecinfo/PhpSecInfo/PhpSecInfo.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 computeStyleTests has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function computeStyleTests() {
        var contents, divStyle,
            documentElement = document.documentElement;

        // Setup
Severity: Minor
Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

    Function get has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        get:function(){
            var element=this,domTokenList=(element.getAttribute('class')||'').replace(/^\s+|\s$/g,'').split(/\s+/g);
            if (domTokenList[0]==='') domTokenList.splice(0,1);
            function setClass(){
                if (domTokenList.length > 0) element.setAttribute('class', domTokenList.join(' '));
    Severity: Minor
    Found in phpsysinfo/js/vendor/bootstrap-ie9.js - About 1 hr to fix

      Function fnInit has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  "fnInit": function ( oSettings, nPaging, fnCallbackDraw )
                  {
                      var nPrevious, nNext, nPreviousInner, nNextInner;
                      
                      /* Store the next and previous elements in the oSettings object as they can be very
      Severity: Minor
      Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

        Function _fnCreateCookie has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function _fnCreateCookie ( sName, sValue, iSecs, sBaseName, fnCallback )
                {
                    var date = new Date();
                    date.setTime( date.getTime()+(iSecs*1000) );
                    
        Severity: Minor
        Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

          Function get has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              get:function(){
                  var element=this,domTokenList=(element.getAttribute('class')||'').replace(/^\s+|\s$/g,'').split(/\s+/g);
                  if (domTokenList[0]==='') domTokenList.splice(0,1);
                  function setClass(){
                      if (domTokenList.length > 0) element.setAttribute('class', domTokenList.join(' '));
          Severity: Minor
          Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

            Method _voltage has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function _voltage()
                {
                    $sname = '';
                    foreach ($this->_lines as $line) {
                        if ((trim($line) !== "") && (strpos($line, ':') === false)) {
            Severity: Minor
            Found in phpsysinfo/includes/mb/class.lmsensors.inc.php - About 1 hr to fix

              Method _current has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function _current()
                  {
                      $sname = '';
                      foreach ($this->_lines as $line) {
                          if ((trim($line) !== "") && (strpos($line, ':') === false)) {
              Severity: Minor
              Found in phpsysinfo/includes/mb/class.lmsensors.inc.php - About 1 hr to fix

                Method _analyze has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function _analyze($script, $regexp, $encode)
                    {
                        // analyse
                        // retreive all words in the script
                        $all = array();
                Severity: Minor
                Found in phpsysinfo/includes/js/class.JavaScriptPacker.inc.php - About 1 hr to fix

                  Method _network has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function _network()
                      {
                          CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-25,44- | grep Link | grep -v \'* \'', $netstat_b, PSI_DEBUG);
                          CommonFunctions::executeProgram('netstat', '-ndi | cut -c1-25,44- | grep Link | grep -v \'* \'', $netstat_n, PSI_DEBUG);
                          $lines_b = preg_split("/\n/", $netstat_b, -1, PREG_SPLIT_NO_EMPTY);
                  Severity: Minor
                  Found in phpsysinfo/includes/os/class.OpenBSD.inc.php - About 1 hr to fix

                    Method _network has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function _network()
                        {
                            CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"', $netstat_b);
                            CommonFunctions::executeProgram('netstat', '-ndi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"', $netstat_n);
                            $lines_b = preg_split("/\n/", $netstat_b, -1, PREG_SPLIT_NO_EMPTY);
                    Severity: Minor
                    Found in phpsysinfo/includes/os/class.NetBSD.inc.php - About 1 hr to fix

                      Method _hardware has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function _hardware()
                          {
                              foreach ($this->_devicelist('PCI') as $pciDev) {
                                  $dev = new HWDevice();
                                  $dev->setName($pciDev['Name']);
                      Severity: Minor
                      Found in phpsysinfo/includes/os/class.WINNT.inc.php - About 1 hr to fix

                        Method _info has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function _info()
                            {
                                if (! empty($this->_output)) {
                                    foreach ($this->_output as $name => $value) {
                                        $temp = preg_split("/\n/", $value, -1, PREG_SPLIT_NO_EMPTY);
                        Severity: Minor
                        Found in phpsysinfo/includes/ups/class.nut.inc.php - About 1 hr to fix

                          Function _fnDetectHeader has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function _fnDetectHeader ( aLayout, nThead )
                                  {
                                      var nTrs = $(nThead).children('tr');
                                      var nCell;
                                      var i, j, k, l, iLen, jLen, iColShifted;
                          Severity: Minor
                          Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                            Function _fnSetObjectDataFn has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function _fnSetObjectDataFn( mSource )
                                    {
                                        if ( mSource === null )
                                        {
                                            /* Nothing to do when the data source is null */
                            Severity: Minor
                            Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                              Method _fans has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function _fans()
                                  {
                                      $sname = '';
                                      foreach ($this->_lines as $line) {
                                          if ((trim($line) !== "") && (strpos($line, ':') === false)) {
                              Severity: Minor
                              Found in phpsysinfo/includes/mb/class.lmsensors.inc.php - About 1 hr to fix

                                Method cpuinfo has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function cpuinfo()
                                    {
                                        $dev = new CpuDevice();
                                
                                        if (PSI_OS == "NetBSD") {
                                Severity: Minor
                                Found in phpsysinfo/includes/os/class.BSDCommon.inc.php - About 1 hr to fix

                                  Method _info has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private function _info()
                                      {
                                          foreach ($this->_output as $ups) {
                                  
                                              $dev = new UPSDevice();
                                  Severity: Minor
                                  Found in phpsysinfo/includes/ups/class.powersoftplus.inc.php - About 1 hr to fix

                                    Method enumKey has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
                                        {
                                            $_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
                                    
                                            $arrBuffer = array();
                                    Severity: Minor
                                    Found in phpsysinfo/includes/class.CommonFunctions.inc.php - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                  if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
                                                      ( support.htmlSerialize || !rnoshimcache.test( value )  ) &&
                                                      ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
                                                      !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
                                      
                                      
                                      Severity: Critical
                                      Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language