XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function _buildMemory has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function _buildMemory()
    {
        $memory = $this->_xml->addChild('Memory');
        $memory->addAttribute('Free', $this->_sys->getMemFree());
        $memory->addAttribute('Used', $this->_sys->getMemUsed());
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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        $i = 0;
        $quotas = array();
        foreach ($this->_filecontent as $thisline) {
Severity: Minor
Found in phpsysinfo/plugins/quotas/class.quotas.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 getUnixId has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getUnixId()
    {
        if ($this->osIsWindows()) {
            return false;
        }
Severity: Minor
Found in phpsecinfo/PhpSecInfo/Test/Test.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 execute has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        $this->_lines = array();
        switch (strtolower(PSI_PLUGIN_UPRECORDS_ACCESS)) {
            case 'command':
Severity: Minor
Found in phpsysinfo/plugins/uprecords/class.uprecords.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 XoopsInfo_moduleoption has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function XoopsInfo_moduleoption($option, $repmodule = 'xoopsinfo')
{
    global $xoopsModuleConfig, $xoopsModule;

    static $tbloptions = [];
Severity: Minor
Found in modules/xoopsinfo/include/functions.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 fetchMedia has a Cognitive Complexity of 11 (exceeds 5 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

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 promise has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

jQuery.ready.promise = function( obj ) {
    if ( !readyList ) {
        readyList = jQuery.Deferred();

        // Catch cases where $(document).ready() is called
Severity: Minor
Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

    Function removeClass has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        removeClass: function( value ) {
            var classes, elem, cur, curValue, clazz, j, finalValue,
                i = 0;
    
            if ( jQuery.isFunction( value ) ) {
    Severity: Minor
    Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

      Function handlers has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          handlers: function( event, handlers ) {
              var i, matches, sel, handleObj,
                  handlerQueue = [],
                  delegateCount = handlers.delegateCount,
                  cur = event.target;
      Severity: Minor
      Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

        Function hide has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _proto.hide = function hide(event) {
              var _this2 = this;
        
              if (event) {
                event.preventDefault();
        Severity: Minor
        Found in phpsysinfo/js/vendor/bootstrap-modal.js - About 1 hr to fix

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

              protected function cpuinfo()
              {
                  $dev = new CpuDevice();
                  $dev->setModel($this->grabkey('hw.model'));
                  $dev->setCpuSpeed($this->grabkey('hw.cpuspeed'));
          Severity: Minor
          Found in phpsysinfo/includes/os/class.OpenBSD.inc.php - About 1 hr to fix

            Function renderPlugin_uprecords has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function renderPlugin_uprecords(data) {
            
                var directives = {
                    hash: {
                        html: function () {
            Severity: Minor
            Found in phpsysinfo/plugins/uprecords/js/uprecords_bootstrap.js - About 1 hr to fix

              Function ifixpng has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  $.fn.ifixpng =  hack.ltie7 ? function(customPixel) {
                      if (customPixel !== undefined) {
                          $.ifixpng.pixel = customPixel;
                      }
                      return this.each(function() {
              Severity: Minor
              Found in phpsysinfo/js/jQuery/jquery.ifixpng.js - About 1 hr to fix

                Function attr has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    attr: function( elem, name, value ) {
                        var ret, hooks,
                            nType = elem.nodeType;
                
                        // Don't get/set attributes on text, comment and attribute nodes
                Severity: Minor
                Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

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

                      private function _voltage()
                      {
                          if (count($this->_values) == 14) {
                              $dev1 = new SensorDevice();
                              $dev1->setName('Vcore1');
                  Severity: Minor
                  Found in phpsysinfo/includes/mb/class.healthd.inc.php - About 1 hr to fix

                    Method _cpuinfo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function _cpuinfo()
                        {
                    
                            if (CommonFunctions::executeProgram('sysinfo', '-cpu', $bufr, PSI_DEBUG)) {
                                $cpus = preg_split("/\nCPU #\d+/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
                    Severity: Minor
                    Found in phpsysinfo/includes/os/class.Haiku.inc.php - About 1 hr to fix

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

                          protected function _pci()
                          {
                              $prtconf = $this->prtconf();
                              if ((count($prtconf)>1) && isset($prtconf['pci'])) {
                                  foreach ($prtconf['pci'] as $prt) {
                      Severity: Minor
                      Found in phpsysinfo/includes/os/class.SunOS.inc.php - About 1 hr to fix

                        Function changeSpanLanguage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function changeSpanLanguage(plugin) {
                            var langId = "", langStr = "", langarrId = current_language + "_";
                        
                            if (plugin === undefined) {
                                langarrId += "phpSysInfo";
                        Severity: Minor
                        Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 1 hr to fix

                          Function changeSpanLanguage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function changeSpanLanguage(plugin) {
                              var langId = "", langStr = "", langarrId = current_language + "_";
                          
                              if (plugin === undefined) {
                                  langarrId += "phpSysInfo";
                          Severity: Minor
                          Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 1 hr to fix

                            Function formatBPS has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function formatBPS(bps) {
                                var show = "";
                            
                                if (bps > Math.pow(1000, 5)) {
                                    show += round(bps / Math.pow(1000, 5), 2);
                            Severity: Minor
                            Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language