Showing 1,065 of 16,781 total issues
Function _voltage
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
private function _voltage()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
- 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 32 (exceeds 5 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)
- 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 _fnGatherData
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnGatherData( oSettings )
{
var iLoop, i, iLen, j, jLen, jInner,
nTds, nTrs, nTd, aLocalData, iThisIndex,
iRow, iRows, iColumn, iColumns, sNodeName;
Method __construct
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
$RaidProgs = array();
Consider simplifying this complex logical expression. Open
if (CommonFunctions::fileexists($filename="/etc/DISTRO_SPECS")
&& CommonFunctions::rfts($filename, $buf, 0, 4096, false)
&& preg_match('/^DISTRO_NAME=\'(.+)\'/m', $buf, $id_buf)) {
if (isset($list[trim($id_buf[1])]['Name'])) {
$dist = trim($list[trim($id_buf[1])]['Name']);
Consider simplifying this complex logical expression. Open
if (preg_match('/^[dD]esign capacity:\s*(.*) (.*)$/', $roworig, $data)
|| preg_match('/^energy-full-design:\s*(.*) (.*)$/', $roworig, $data)) {
$bat['design_capacity'] = str_replace(',', '.', $data[1])+0;
if (!isset($bat['capacity_unit'])) {
$bat['capacity_unit'] = trim($data[2]);
Function _fnAddOptionsHtml
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnAddOptionsHtml ( oSettings )
{
/*
* Create a temporary, empty, div which we can later on replace with what we have generated
* we do it this way to rendering the 'options' html offline - speed :-)
Function jqTreeTable
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
jq.fn.jqTreeTable=function(map, options){
var opts = jq.extend({openImg:"",shutImg:"",leafImg:"",lastOpenImg:"",lastShutImg:"",lastLeafImg:"",vertLineImg:"",blankImg:"",collapse:false,column:0,striped:false,highlight:false,state:true},options),
mapa=[],mapb=[],tid=this.attr("id"),collarr=[],
stripe=function(){
if(opts.striped){
Function _fnSortingClasses
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _fnSortingClasses( oSettings )
{
var i, iLen, j, jLen, iFound;
var aaSort, sClass;
var iColumns = oSettings.aoColumns.length;
Function renderUPS
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function renderUPS(data) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('ups', blocks) < 0))) {
$("#block_ups").remove();
return;
}
- 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 xml
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function xml()
{
foreach ($this->_result as $printer=>$markersupplies_item) {
$xmlsnmppinfo_printer = $this->xml->addChild("Printer");
$xmlsnmppinfo_printer->addAttribute("Device", $printer);
- 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 _outputRenderTable
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function _outputRenderTable($group_name, $group_results)
{
// exit out if $group_results was empty or not an array. This sorta seems a little hacky...
if (!is_array($group_results) || count($group_results) < 1) {
return false;
- 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
File class.SunOS.inc.php
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* SunOS System Class
*
* PHP version 5
Function renderVitals
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderVitals(data) {
var hostname = "", ip = "";
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('vitals', blocks) < 0))) {
$("#block_vitals").remove();
Function renderMemory
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderMemory(data) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('memory', blocks) < 0))) {
$("#block_memory").remove();
return;
}
Function formatBytes
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatBytes(bytes, byteFormat, parenths) {
var show = "";
if (byteFormat === undefined) {
byteFormat = "auto_binary";
Method __construct
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($enc)
{
parent::__construct(__CLASS__, $enc);
switch (strtolower(PSI_PLUGIN_SNMPPINFO_ACCESS)) {
case 'command':
Function _fans
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function _fans()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
- 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 30 (exceeds 5 allowed). Consider refactoring. Open
private function _voltage()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[2]) && $buffer[2] == "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 30 (exceeds 5 allowed). Consider refactoring. Open
private function _current()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if (isset($buffer[2]) && $buffer[2] == "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"