XoopsModules25x/xoopsinfo

View on GitHub

Showing 1,065 of 16,781 total issues

Function _kernel has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function _kernel()
    {
        if (CommonFunctions::executeProgram('uname', '-rvm', $ret)) {
            foreach ($this->readdmesg() as $line) {
                if (preg_match('/kernel: MINIX (\d+\.\d+\.\d+)\. \((.+)\)/', $line, $ar_buf)) {
Severity: Minor
Found in phpsysinfo/includes/os/class.Minix.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 _machine has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function _machine()
    {
        if ($lines = $this->_get_buildprop()) {
            $buf = "";
            if (preg_match('/^ro\.product\.manufacturer=([^\n]+)/m', $lines, $ar_buf) && (trim($ar_buf[1]) !== "unknown")) {
Severity: Minor
Found in phpsysinfo/includes/os/class.Android.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 __construct has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($enc)
    {
        parent::__construct(__CLASS__, $enc);
        switch (strtolower(PSI_PLUGIN_UPDATENOTIFIER_ACCESS)) {
        case 'command':
Severity: Minor
Found in phpsysinfo/plugins/updatenotifier/class.updatenotifier.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 __construct has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($plugin = "")
    {
        parent::__construct();

        if (is_string($plugin) && ($plugin !== "")) {
Severity: Minor
Found in phpsysinfo/includes/output/class.WebpageXML.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 Get_TypeList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function Get_TypeList() {
        $ret = array();
        $sql = 'SELECT * FROM ' . $this->db->prefix("mimetypes") ;

        $result = $this->db->query($sql);
Severity: Minor
Found in kernel/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 upload has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function upload($chmod = 0644) {
        if ($this->uploadDir == '') {
            $this->setErrors( _ER_UP_UPLOADDIRNOTSET );
            return false;
        }
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 insert has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function insert(&$mimetype_object, $force = false) {
        if (strtolower(get_class($mimetype_object)) != 'xoopsmimetypes_perms') {
            return false;
        }
        if (!$mimetype_object->isDirty()) {
Severity: Minor
Found in kernel/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 insert has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    function insert(&$mimetype_object, $force = false) {
        if (strtolower(get_class($mimetype_object)) != 'xoopsmimetypes') {
            return false;
        }
        if (!$mimetype_object->isDirty()) {
Severity: Minor
Found in kernel/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 loadTests has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadTests()
    {
        $test_root = dir(__DIR__ . DIRECTORY_SEPARATOR . 'Test');

        // echo "<pre>"; echo print_r($test_root, true); echo "</pre>";
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 renderOther has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function renderOther(data) {
    if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('other', blocks) < 0))) {
        $("#block_other").remove();
        return;
    }
Severity: Minor
Found in phpsysinfo/js/phpSysInfo/phpsysinfo_bootstrap.js - About 1 hr to fix

    Function refreshCurrent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function refreshCurrent(xml) {
        if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('current', blocks) < 0))) {
            $("#current").remove();
            return;
        }
    Severity: Minor
    Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 1 hr to fix

      Function refreshVoltage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function refreshVoltage(xml) {
          if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('voltage', blocks) < 0))) {
              $("#voltage").remove();
              return;
          }
      Severity: Minor
      Found in phpsysinfo/js/phpSysInfo/phpsysinfo.js - About 1 hr to fix

        Function genlang has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function genlang has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function propFilter has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function propFilter( props, specialEasing ) {
                var index, name, easing, value, hooks;
            
                // camelCase, specialEasing and expand cssHook pass
                for ( index in props ) {
            Severity: Minor
            Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix

              Function implement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  implement: function (linkElement) {
                      if (!linkElement.href) {
                          return;
                      }
              
              
              Severity: Minor
              Found in phpsysinfo/js/vendor/bootstrap-ie8.js - About 1 hr to fix

                Function fnDeleteRow has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        this.fnDeleteRow = function( mTarget, fnCallBack, bRedraw )
                        {
                            /* Find settings from table node */
                            var oSettings = _fnSettingsFromNode( this[_oExt.iApiIndex] );
                            var i, iAODataIndex;
                Severity: Minor
                Found in phpsysinfo/js/jQuery/jquery.dataTables.js - About 1 hr to fix

                  Function renderPlugin_psstatus has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function renderPlugin_psstatus(data) {
                  
                      var directives = {
                          Status1: {
                              text: function () {
                  Severity: Minor
                  Found in phpsysinfo/plugins/psstatus/js/psstatus_bootstrap.js - About 1 hr to fix

                    Function implement has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        implement: function (linkElement) {
                            if (!linkElement.href) {
                                return;
                            }
                    
                    
                    Severity: Minor
                    Found in phpsysinfo/js/vendor/bootstrap-ie9.js - About 1 hr to fix

                      Function setup has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              setup: function() {
                      
                                  if ( rformElems.test( this.nodeName ) ) {
                      
                                      // IE doesn't fire change on a check/radio until blur; trigger it on click
                      Severity: Minor
                      Found in phpsysinfo/js/jQuery/jquery.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language