XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function usb has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function usb()
    {
        $s = $this->_grabioreg('IOUSBDevice');
        $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
        foreach ($lines as $line) {
Severity: Minor
Found in phpsysinfo/includes/os/class.Darwin.inc.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 _ip has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _ip()
    {
        if (PSI_USE_VHOST === true) {
           if ((CommonFunctions::readenv('SERVER_ADDR', $result) || CommonFunctions::readenv('LOCAL_ADDR', $result)) //is server address defined
               && !strstr($result, '.') && strstr($result, ':')) { //is IPv6, quick version of preg_match('/\(([[0-9A-Fa-f\:]+)\)/', $result)
Severity: Minor
Found in phpsysinfo/includes/os/class.OS.inc.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 _buildNetwork has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function _buildNetwork()
    {
        $hideDevices = array();
        $network = $this->_xml->addChild('Network');
        if (defined('PSI_HIDE_NETWORK_INTERFACE')) {
Severity: Minor
Found in phpsysinfo/includes/xml/class.XML.inc.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 list_mimetypes has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function list_mimetypes()
{
    global $uri, $status, $mid, $start, $type;

    $mimetypes_Handler = xoops_getHandler('mimetypes');
Severity: Minor
Found in modules/xoopsinfo/include/mimetypes.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 select has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

select = Sizzle.select = function( selector, context, results, seed ) {
    var i, tokens, token, type, find,
        compiled = typeof selector === "function" && selector,
        match = !seed && tokenize( (selector = compiled.selector || selector) );

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

    Function _fnFilter has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            function _fnFilter( oSettings, sInput, iForce, bRegex, bSmart )
            {
                var i;
                var rpSearch = _fnFilterCreateSearch( sInput, bRegex, bSmart );
                
    Severity: Minor
    Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

      Function _fnPageChange has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function _fnPageChange ( oSettings, sAction )
              {
                  var iOldStart = oSettings._iDisplayStart;
                  
                  if ( sAction == "first" )
      Severity: Minor
      Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

        Function _fnAjaxUpdateDraw has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function _fnAjaxUpdateDraw ( oSettings, json )
                {
                    if ( typeof json.sEcho != 'undefined' )
                    {
                        /* Protect against old returns over-writing a new one. Possible when you get
        Severity: Minor
        Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

          Function raid_diskicon has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function raid_diskicon(data , id, itemid) {
                  var info = "";
          
                  info = data.Info;
                  if (info === undefined) info = "";
          Severity: Minor
          Found in phpsysinfo/plugins/raid/js/raid_bootstrap.js - About 1 hr to fix

            Method _prepare has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function _prepare()
                {
                    if ($this->_pluginName === null) {
                        // Figure out which OS we are running on, and detect support
                        if (!file_exists(PSI_APP_ROOT.'/includes/os/class.'.PSI_OS.'.inc.php')) {
            Severity: Minor
            Found in phpsysinfo/includes/output/class.WebpageXML.inc.php - About 1 hr to fix

              Method fetchMedia has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function fetchMedia($media_name, $index = null) {
              /*
                      if ( empty( $this->extensionToMime ) ) {
              */
                      if ( count( $this->extensionToMime ) == 0 ) {
              Severity: Minor
              Found in class/uploader.php - About 1 hr to fix

                Function matcherFromTokens has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function matcherFromTokens( tokens ) {
                    var checkContext, matcher, j,
                        len = tokens.length,
                        leadingRelative = Expr.relative[ tokens[0].type ],
                        implicitRelative = leadingRelative || Expr.relative[" "],
                Severity: Minor
                Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                  Function tokenize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
                      var matched, match, tokens, type,
                          soFar, groups, preFilters,
                          cached = tokenCache[ selector + " " ];
                  
                  
                  Severity: Minor
                  Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                    Function _fnAjaxParameters has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function _fnAjaxParameters( oSettings )
                            {
                                var iColumns = oSettings.aoColumns.length;
                                var aoData = [], mDataProp;
                                var i;
                    Severity: Minor
                    Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                      Function val has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          val: function( value ) {
                              var hooks, ret, isFunction,
                                  elem = this[ 0 ];
                      
                              if ( !arguments.length ) {
                      Severity: Minor
                      Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

                        Function snmppinfo_getprinters has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            $("Plugins Plugin_SNMPPInfo Printer MarkerSupplies", xml).each(function snmppinfo_getprinters(id) {
                                var close = 0, name = "", device = "", desc = "", unit = 0, max = 0, level = 0, percent = 0, units = "", supply = 0, sunits = "";
                                name = $(this).parent().attr("Name");
                                device = $(this).parent().attr("Device");
                                desc = $(this).attr("Description");
                        Severity: Minor
                        Found in phpsysinfo/plugins/snmppinfo/js/snmppinfo.js - About 1 hr to fix

                          Function _fnSaveState has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function _fnSaveState ( oSettings )
                                  {
                                      if ( !oSettings.oFeatures.bStateSave || typeof oSettings.bDestroying != 'undefined' )
                                      {
                                          return;
                          Severity: Minor
                          Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                            Function _fnCreateTr has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function _fnCreateTr ( oSettings, iRow )
                                    {
                                        var oData = oSettings.aoData[iRow];
                                        var nTd;
                            
                            
                            Severity: Minor
                            Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                              Method _pci has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function _pci()
                                  {
                                      if ($arrResults = Parser::lspci()) {
                                          foreach ($arrResults as $dev) {
                                              $this->sys->setPciDevices($dev);
                              Severity: Minor
                              Found in phpsysinfo/includes/os/class.Linux.inc.php - About 1 hr to fix

                                Method run has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function run()
                                    {
                                        $this->_checkTemplateLanguage();
                                
                                        $tpl = new Template("/templates/html/index_".$this->_indexname.".html");
                                Severity: Minor
                                Found in phpsysinfo/includes/output/class.Webpage.inc.php - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language