XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function _pci has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function _pci()
    {
        if (CommonFunctions::executeProgram('lspci', '', $bufr, false)) {
            $bufe = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($bufe as $buf) {
Severity: Minor
Found in phpsysinfo/includes/os/class.Android.inc.php - About 35 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 _network has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function _network()
    {
        if (CommonFunctions::executeProgram('netstat', '-ni | tail -n +2', $netstat)) {
            $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
            foreach ($lines as $line) {
Severity: Minor
Found in phpsysinfo/includes/os/class.AIX.inc.php - About 35 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 _fillDevice has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function _fillDevice(SimpleXMLExtended $mount, DiskDevice $dev, $i)
    {
        $mount->addAttribute('MountPointID', $i);
        if ($dev->getFsType()!=="") $mount->addAttribute('FSType', $dev->getFsType());
        $mount->addAttribute('Name', $dev->getName());
Severity: Minor
Found in phpsysinfo/includes/xml/class.XML.inc.php - About 35 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 _getTemplateList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private function _getTemplateList()
    {
        $dirlist = CommonFunctions::gdc(PSI_APP_ROOT.'/templates/');
        sort($dirlist);
        foreach ($dirlist as $file) {
Severity: Minor
Found in phpsysinfo/includes/output/class.Webpage.inc.php - About 35 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 delete has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function delete(&$mimetype_object, $force = false) {
        if (strtolower(get_class($mimetype_object)) != 'xoopsmimetypes') {
            return false;
        }

Severity: Minor
Found in kernel/mimetypes.php - About 35 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 execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute()
    {
        if (defined('PSI_PLUGIN_PINGTEST_ADDRESSES') && is_string(PSI_PLUGIN_PINGTEST_ADDRESSES)) {
            if (preg_match(ARRAY_EXP, PSI_PLUGIN_PINGTEST_ADDRESSES)) {
                $addresses = eval(PSI_PLUGIN_PINGTEST_ADDRESSES);
Severity: Minor
Found in phpsysinfo/plugins/pingtest/class.pingtest.inc.php - About 35 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 allowedMimeTypes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function allowedMimeTypes( $mid, $groups, $allowedMimeTypes ) {
        $ret = array();
        $sql = 'SELECT p.mperm_groups, t.mime_ext, t.mime_types FROM ' . $this->db->prefix('mimetypes_perms') . ' p LEFT JOIN ' .
        $this->db->prefix("mimetypes") . ' t on p.mperm_mime = t.mime_id WHERE mperm_module=' . $mid;

Severity: Minor
Found in kernel/mimetypes.php - About 35 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 getErrors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    function &getErrors($ashtml = true) {
        if (!$ashtml) {
            return $this->errors;
        } else {
            $ret = '';
Severity: Minor
Found in class/uploader.php - About 35 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 runTests has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function runTests()
    {
        // initialize a bunch of arrays
        $this->test_results = [];

Severity: Minor
Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 35 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 _outputRenderStatsTable has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function _outputRenderStatsTable()
    {
        // Add by
        // https://github.com/bigdeej/PhpSecInfo/tree/master/PhpSecInfo/Test/Core
        $score = 100;
Severity: Minor
Found in phpsecinfo/PhpSecInfo/PhpSecInfo.php - About 35 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

Avoid too many return statements within this function.
Open

            return sortInput ?
                ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
                0;
Severity: Major
Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return select( selector.replace( rtrim, "$1" ), context, results, seed );
    Severity: Major
    Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return value;
      Severity: Major
      Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return compare & 4 ? -1 : 1;
        Severity: Major
        Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return this.constructor( context ).find( selector );
          Severity: Major
          Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return key === undefined || hasOwn.call( obj, key );
            Severity: Major
            Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                  return results;
              Severity: Major
              Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return results;
                Severity: Major
                Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return jQuery.makeArray( selector, this );
                  Severity: Major
                  Found in phpsysinfo/js/jQuery/jquery.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                return 'numeric';
                    Severity: Major
                    Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language