XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Avoid too many return statements within this method.
Open

        return false;
Severity: Major
Found in class/uploader.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return true;
    Severity: Major
    Found in class/uploader.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return true;
      Severity: Major
      Found in kernel/mimetypes.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return true;
        Severity: Major
        Found in kernel/mimetypes.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return 'value-notrun';
          Severity: Major
          Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                            return 'value-error';
            Severity: Major
            Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return false;
              Severity: Major
              Found in phpsecinfo/PhpSecInfo/Test/Test.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $ini_val;
                Severity: Major
                Found in phpsecinfo/PhpSecInfo/Test/Test.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return 'Invalid Result Code';
                  Severity: Major
                  Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return 'Error';
                    Severity: Major
                    Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 30 mins to fix

                      Function round has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function round(x, n) {
                          var e = 0, k = "";
                          if (n < 0 || n > 14) {
                              return 0;
                          }
                      Severity: Minor
                      Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 25 mins 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 renderPlugin_iptables has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function renderPlugin_iptables(data) {
                      
                          var directives = {
                              Rule: {
                                  html: function () {
                      Severity: Minor
                      Found in phpsysinfo/plugins/iptables/js/iptables_bootstrap.js - About 25 mins 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 2 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      },{"../lib/lodash.js":7,"./context":3,"./helpers":5}],2:[function(require,module,exports){
                      var Attribute, AttributeFactory, BooleanAttribute, Class, Html, Text, helpers, _,
                        __hasProp = {}.hasOwnProperty,
                        __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
                      
                      
                      Severity: Minor
                      Found in phpsysinfo/js/vendor/transparency.js - About 25 mins 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 renderPlugin_updatenotifier has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function renderPlugin_updatenotifier(data) {
                      
                          var directives = {
                              updateNotifierNbPackages: {
                                  text: function () {
                      Severity: Minor
                      Found in phpsysinfo/plugins/updatenotifier/js/updatenotifier_bootstrap.js - About 25 mins 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 raid_buildaction has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function raid_buildaction(xml) {
                          var html = "", name = "", time = "", tunit = "", percent = 0;
                          $("Action", xml).each(function mdstatus_getaction(id) {
                              name = $(this).attr("Name");
                              if (parseInt(name, 10) !== -1) {
                      Severity: Minor
                      Found in phpsysinfo/plugins/raid/js/raid.js - About 25 mins 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 renderPlugin_docker has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function renderPlugin_docker(data) {
                      
                          var directives = {
                              CPUUsage: {
                                  html: function () {
                      Severity: Minor
                      Found in phpsysinfo/plugins/docker/js/docker_bootstrap.js - About 25 mins 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 _fans has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function _fans()
                          {
                              foreach ($this->_lines as $line) {
                                  if (preg_match('/^hw\.sensors\.[0-9]+=[^\s,]+,\s+([^,]+),\s+fanrpm,\s+([0-9\.]+)\s+RPM.*$/', $line, $ar_buf)) {
                                      $dev = new SensorDevice();
                      Severity: Minor
                      Found in phpsysinfo/includes/mb/class.hwsensors.inc.php - About 25 mins 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 build has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function build()
                          {
                              $this->error->addError("WARN", "The QNX version of phpSysInfo is a work in progress, some things currently don't work");
                              if (!$this->blockname || $this->blockname==='vitals') {
                                  $this->_distro();
                      Severity: Minor
                      Found in phpsysinfo/includes/os/class.QNX.inc.php - About 25 mins 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 _fans has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private function _fans()
                          {
                              foreach ($this->_lines as $line) {
                                  if (preg_match('/^(FAN\d*)\s*:\s*(.*)$/D', $line, $data)) {
                                      if ($data[2] <> '0') {
                      Severity: Minor
                      Found in phpsysinfo/includes/mb/class.mbmon.inc.php - About 25 mins 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 _usb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function _usb()
                          {
                              if (CommonFunctions::executeProgram('listusb', '', $bufr, PSI_DEBUG)) {
                                  $devices = preg_split("/\n/", $bufr);
                                  foreach ($devices as $device) {
                      Severity: Minor
                      Found in phpsysinfo/includes/os/class.Haiku.inc.php - About 25 mins 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