Showing 1,065 of 16,781 total issues
Function quotas_buildTable
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
function quotas_buildTable() {
var html = "";
html += "<div style=\"overflow-x:auto;\">\n";
html += " <table id=\"Plugin_QuotasTable\" style=\"border-collapse:collapse;\">\n";
Method cpuinfo
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function cpuinfo()
{
$dev = new CpuDevice();
if (CommonFunctions::executeProgram('hostinfo', '| grep "Processor type"', $buf, PSI_DEBUG)) {
$dev->setModel(preg_replace('/Processor type: /', '', $buf));
Method _buildVitals
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _buildVitals()
{
$vitals = $this->_xml->addChild('Vitals');
$vitals->addAttribute('Hostname', $this->_sys->getHostname());
$vitals->addAttribute('IPAddr', $this->_sys->getIp());
Method __construct
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
if (defined('PSI_PLUGIN_PINGTEST_ADDRESSES') && is_string(PSI_PLUGIN_PINGTEST_ADDRESSES)) {
if (preg_match(ARRAY_EXP, PSI_PLUGIN_PINGTEST_ADDRESSES)) {
Consider simplifying this complex logical expression. Open
if ($editor['class'] && is_readable(XOOPS_ROOT_PATH . $editor['class']) && $isModule) {
echo '<img src="../images/icons/on.gif" alt="' . _AM_XI_EDITOR_OK . '"align="absmiddle" />';
} elseif ($editor['class'] && is_readable(XOOPS_ROOT_PATH . $editor['class']) && $editor['dirname'] && !$isModule) {
echo '<img src="../images/icons/notinstalled.gif" alt="' . _AM_XI_EDITOR_MODULE . '"align="absmiddle" />';
} elseif ($editor['class'] && !is_readable(XOOPS_ROOT_PATH . $editor['class']) && $isModule) {
Function internalRemoveData
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function internalRemoveData( elem, name, pvt ) {
if ( !acceptData( elem ) ) {
return;
}
Function _fnAddData
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnAddData ( oSettings, aDataSupplied )
{
var oCol;
/* Take an independent copy of the data source so we can bash it about as we wish */
Function _fnAddColumn
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnAddColumn( oSettings, nTh )
{
var iCol = oSettings.aoColumns.length;
var oCol = {
"sType": null,
Method _parseProcStat
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _parseProcStat($cpuline)
{
if (is_null($this->_cpu_loads)) {
$this->_cpu_loads = array();
Function internalData
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
if ( !acceptData( elem ) ) {
return;
}
Function 3
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
},{"../lib/lodash":7,"./helpers":5}],3:[function(require,module,exports){
var Context, Instance, after, before, chainable, cloneNode, _ref;
_ref = require('./helpers'), before = _ref.before, after = _ref.after, chainable = _ref.chainable, cloneNode = _ref.cloneNode;
Method _bootStrap
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _bootStrap($packed, $keywords)
{
$ENCODE = $this->_safeRegExp('$encode\\($count\\)');
// $packed: the packed script
Method _network
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _network()
{
if (CommonFunctions::executeProgram('ifconfig', '', $bufr, PSI_DEBUG)) {
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
$was = false;
Method insert
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function insert(&$mimetype_object, $force = false) {
if (strtolower(get_class($mimetype_object)) != 'xoopsmimetypes') {
return false;
}
if (!$mimetype_object->isDirty()) {
Function reload
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function reload(initiate) {
$.ajax({
url: 'xml.php',
dataType: 'xml',
error: function error() {
- 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 raid_diskicon
has a Cognitive Complexity of 15 (exceeds 5 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");
- 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 _replacement
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function _replacement($arguments)
{
if (empty($arguments)) return '';
$i = 1; $j = 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 removeDupsAndCount
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function removeDupsAndCount($arrDev)
{
$result = array();
foreach ($arrDev as $dev) {
if (count($result) === 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 _voltage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function _voltage()
{
foreach ($this->_buf as $sensor) {
if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Voltage'))
||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Voltage')))
- 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 _current
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function _current()
{
foreach ($this->_buf as $sensor) {
if (((isset($sensor['Sensor Type (Threshold)']) && ($sensor['Sensor Type (Threshold)'] == 'Current'))
||(isset($sensor['Sensor Type (Analog)']) && ($sensor['Sensor Type (Analog)'] == 'Current')))
- 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"