Showing 1,065 of 16,781 total issues
Method _machine
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _machine()
{
$machine = "";
if ((CommonFunctions::rfts('/var/log/dmesg', $result, 0, 4096, false)
&& preg_match('/^[\s\[\]\.\d]*DMI:\s*(.*)/m', $result, $ar_buf))
Method _network
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _network()
{
if (CommonFunctions::executeProgram('netstat', '-ni | awk \'(NF ==10){print;}\'', $netstat, PSI_DEBUG)) {
$lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
Function e
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
- Read upRead up
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 getMemPercentBuffer
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getMemPercentBuffer()
{
if ($this->_memBuffer !== null) {
if (($this->_memBuffer > 0) && ($this->_memTotal > 0)) {
if (($this->_memCache !== null) && ($this->_memCache > 0)) {
- Read upRead up
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 16 (exceeds 5 allowed). Consider refactoring. Open
public function build()
{
if (PSI_OS == 'Linux') {
$hwpaths = glob("/sys/devices/platform/coretemp.*/", GLOB_NOSORT);
if (is_array($hwpaths) && (count($hwpaths) > 0)) {
- Read upRead up
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 _ide
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function _ide()
{
$bufd = CommonFunctions::gdc('/proc/ide', false);
foreach ($bufd as $file) {
if (preg_match('/^hd/', $file)) {
- Read upRead up
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 _memory
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function _memory()
{
$mems = "";
$tswap = "";
$pswap = "";
- Read upRead up
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 adminmenu
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function adminmenu($currentoption = 0, $breadcrumb = '')
{
global $xoopsModule, $xoopsConfig, $modversion;
/* Nice buttons styles */
- Read upRead up
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 getMount
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
$("FileSystem Mount", xml).each(function getMount(mid) {
var mpoint = "", mpid = 0, type = "", name = "", free = 0, used = 0, size = 0, percent = 0, options = "", inodes = 0, inodes_text = "", options_text = "", ignore = 0;
mpid = parseInt($(this).attr("MountPointID"), 10);
type = $(this).attr("FSType");
name = $(this).attr("Name").replace(/;/g, ";<wbr>"); /* split long name */
Function raid_diskicon
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function raid_diskicon(xml, id) {
$("RaidItems Item", xml).each(function raid_getitems(itemid) {
var status = "", name = "", type = "", info = "", parentid = 0;
status = $(this).attr("Status");
Function _fnUpdateInfo
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnUpdateInfo ( oSettings )
{
/* Show information about the table */
if ( !oSettings.oFeatures.bInfo || oSettings.aanFeatures.i.length === 0 )
{
Function docker_buildTable
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function docker_buildTable() {
var html = "";
html += "<div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_DockerTable\" class=\"stripeMe\" style=\"border-collapse:collapse;\">\n";
Function raid_buildinfos
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function raid_buildinfos(xml, id) {
var html = "", prog = "", devname = "", devstatus = "", devlevel = "", devcontroller = "", devbattery = "", devsupported = "", devsize = 0, devstride = 0, devsubsets = 0, devdevs = 0, devspares = 0, devchunk = 0, devalgor = "", devpersist = 0, devreg = 0, devact = 0, devcache = 0, devbad = 0, devread = "", devwrite = "", button = "";
prog = $(xml).attr("Program");
devname = $(xml).attr("Name");
Method __construct
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
if (defined('PSI_PLUGIN_PSSTATUS_PROCESSES') && is_string(PSI_PLUGIN_PSSTATUS_PROCESSES)) {
switch (strtolower(PSI_PLUGIN_PSSTATUS_ACCESS)) {
File class.ipmitool.inc.php
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* ipmitool sensor class, getting information from ipmitool
*
* PHP version 5
Method memory
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function memory()
{
$s = $this->grabkey('hw.memsize');
if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
// calculate free memory from page sizes (each page = 4096)
Function refreshHardware
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function refreshHardware(xml) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('hardware', blocks) < 0))) {
$("#hardware").remove();
return;
}
Consider simplifying this complex logical expression. Open
if ( ( mappedTypes || origType === handleObj.origType ) &&
( !handler || handler.guid === handleObj.guid ) &&
( !tmp || tmp.test( handleObj.namespace ) ) &&
( !selector || selector === handleObj.selector ||
selector === "**" && handleObj.selector ) ) {
Function fnInnerSorting
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var fnInnerSorting = function () {
var iColumn, iNextSort;
/* If the shift key is pressed then we are multipe column sorting */
if ( e.shiftKey )
Function raid_getitems
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
$("RaidItems Item", xml).each(function raid_getitems(itemid) {
var status = "", name = "", type = "", info = "", parentid = 0;
status = $(this).attr("Status");
name = $(this).attr("Name");