Showing 1,065 of 16,781 total issues
Method _temperature
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _temperature($hwpath)
{
$sensor = glob($hwpath."temp*_input", GLOB_NOSORT);
if (is_array($sensor) && (($total = count($sensor)) > 0)) {
$buf = "";
Method __construct
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
parent::__construct();
switch (defined('PSI_SENSOR_SPEEDFAN_ACCESS')?strtolower(PSI_SENSOR_SPEEDFAN_ACCESS):'command') {
case 'command':
Method memory
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function memory()
{
if (PSI_OS == 'FreeBSD' || PSI_OS == 'OpenBSD') {
// vmstat on fbsd 4.4 or greater outputs kbytes not hw.pagesize
// I should probably add some version checking here, but for now
Method ide
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function ide()
{
foreach ($this->readdmesg() as $line) {
if (preg_match('/^(.*) at (pciide|wdc|atabus|atapibus)[0-9]+ (.*): <(.*)>/', $line, $ar_buf)
|| preg_match('/^(.*) at (pciide|wdc|atabus|atapibus)[0-9]+ /', $line, $ar_buf)) {
Method _memory
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _memory()
{
if (CommonFunctions::rfts('/proc/meminfo', $mbuf)) {
$bufe = preg_split("/\n/", $mbuf, -1, PREG_SPLIT_NO_EMPTY);
foreach ($bufe as $buf) {
Method _timeoutfgets
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function _timeoutfgets($pipes, &$out, &$err, $timeout)
{
$w = null;
$e = null;
$te = false;
Method _buildMemory
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _buildMemory()
{
$memory = $this->_xml->addChild('Memory');
$memory->addAttribute('Free', $this->_sys->getMemFree());
$memory->addAttribute('Used', $this->_sys->getMemUsed());
Method _retrieveCurrentVersions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _retrieveCurrentVersions()
{
if (!function_exists('curl_init')) {
// Override the OK Message - Even if this passes we can't be 100% sure they are accurate since we didn't fetch the latest version
$this->_message_ok = 'You are running a current stable version of PHP!
Function refreshVoltage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function refreshVoltage(xml) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('voltage', blocks) < 0))) {
$("#voltage").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 fillHWDevice
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function fillHWDevice(xml, type, tree, rootposition) {
var devicecount = 0, html = "";
$("Hardware " + type + " Device", xml).each(function getHWDevice(deviceId) {
var name = "", count = 0, capacity = 0, manufacturer = "", product = "", serial = "", devcoreposition = 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 refreshCurrent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function refreshCurrent(xml) {
if ((blocks.length <= 0) || ((blocks[0] !== "true") && ($.inArray('current', blocks) < 0))) {
$("#current").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 implement
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
implement: function (linkElement) {
if (!linkElement.href) {
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 implement
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
implement: function (linkElement) {
if (!linkElement.href) {
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 _fans
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function _fans()
{
foreach ($this->_lines as $line) {
$buffer = preg_split("/\s*\|\s*/", $line);
if ($buffer[2] == "Fan" && $buffer[11] != "N/A" && $buffer[4] == "RPM") {
- 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 _filesystems
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function _filesystems()
{
if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
$mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {
- 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 _other
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function _other()
{
foreach ($this->_buf as $sensor) {
if (isset($sensor['Sensor Type (Discrete)'])) {
$dev = new SensorDevice();
- 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 _hostname
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function _hostname()
{
if (PSI_USE_VHOST === true) {
if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
} else {
- 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 _cpuinfo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function _cpuinfo()
{
if (CommonFunctions::executeProgram('pidin', 'info', $buf)
&& preg_match('/^Processor\d+: (.*)/m', $buf)) {
$lines = preg_split("/\n/", $buf, -1, PREG_SPLIT_NO_EMPTY);
- 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 _network
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function _network()
{
if (CommonFunctions::executeProgram('ifconfig', '-a', $bufr, PSI_DEBUG)) {
$lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
foreach ($lines as $line) {
- 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 _filesystems
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function _filesystems()
{
if (CommonFunctions::executeProgram('df', '-kP', $df, PSI_DEBUG)) {
$mounts = preg_split("/\n/", $df, -1, PREG_SPLIT_NO_EMPTY);
if (CommonFunctions::executeProgram('mount', '-v', $s, PSI_DEBUG)) {
- 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"