Showing 1,065 of 16,781 total issues
Function renderOutput
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
public function renderOutput($page_title = 'PHP Security Information')
{
/**
* We need to use PhpSecInfo_Test::getBooleanIniValue() below
*
- 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 computeStyleTests
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function computeStyleTests() {
var contents, divStyle,
documentElement = document.documentElement;
// Setup
Function get
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get:function(){
var element=this,domTokenList=(element.getAttribute('class')||'').replace(/^\s+|\s$/g,'').split(/\s+/g);
if (domTokenList[0]==='') domTokenList.splice(0,1);
function setClass(){
if (domTokenList.length > 0) element.setAttribute('class', domTokenList.join(' '));
Function fnInit
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"fnInit": function ( oSettings, nPaging, fnCallbackDraw )
{
var nPrevious, nNext, nPreviousInner, nNextInner;
/* Store the next and previous elements in the oSettings object as they can be very
Function _fnCreateCookie
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnCreateCookie ( sName, sValue, iSecs, sBaseName, fnCallback )
{
var date = new Date();
date.setTime( date.getTime()+(iSecs*1000) );
Function get
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get:function(){
var element=this,domTokenList=(element.getAttribute('class')||'').replace(/^\s+|\s$/g,'').split(/\s+/g);
if (domTokenList[0]==='') domTokenList.splice(0,1);
function setClass(){
if (domTokenList.length > 0) element.setAttribute('class', domTokenList.join(' '));
Method _voltage
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _voltage()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
Method _current
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _current()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
Method _analyze
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _analyze($script, $regexp, $encode)
{
// analyse
// retreive all words in the script
$all = array();
Method _network
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _network()
{
CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-25,44- | grep Link | grep -v \'* \'', $netstat_b, PSI_DEBUG);
CommonFunctions::executeProgram('netstat', '-ndi | cut -c1-25,44- | grep Link | grep -v \'* \'', $netstat_n, PSI_DEBUG);
$lines_b = preg_split("/\n/", $netstat_b, -1, PREG_SPLIT_NO_EMPTY);
Method _network
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _network()
{
CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"', $netstat_b);
CommonFunctions::executeProgram('netstat', '-ndi | cut -c1-25,44- | grep "^[a-z]*[0-9][ \t].*Link"', $netstat_n);
$lines_b = preg_split("/\n/", $netstat_b, -1, PREG_SPLIT_NO_EMPTY);
Method _hardware
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _hardware()
{
foreach ($this->_devicelist('PCI') as $pciDev) {
$dev = new HWDevice();
$dev->setName($pciDev['Name']);
Method _info
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _info()
{
if (! empty($this->_output)) {
foreach ($this->_output as $name => $value) {
$temp = preg_split("/\n/", $value, -1, PREG_SPLIT_NO_EMPTY);
Function _fnDetectHeader
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnDetectHeader ( aLayout, nThead )
{
var nTrs = $(nThead).children('tr');
var nCell;
var i, j, k, l, iLen, jLen, iColShifted;
Function _fnSetObjectDataFn
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fnSetObjectDataFn( mSource )
{
if ( mSource === null )
{
/* Nothing to do when the data source is null */
Method _fans
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _fans()
{
$sname = '';
foreach ($this->_lines as $line) {
if ((trim($line) !== "") && (strpos($line, ':') === false)) {
Method cpuinfo
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function cpuinfo()
{
$dev = new CpuDevice();
if (PSI_OS == "NetBSD") {
Method _info
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function _info()
{
foreach ($this->_output as $ups) {
$dev = new UPSDevice();
Method enumKey
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function enumKey($key, $strName, &$arrBuffer, $booErrorRep = true)
{
$_hkey = array('HKEY_CLASSES_ROOT'=>0x80000000, 'HKEY_CURRENT_USER'=>0x80000001, 'HKEY_LOCAL_MACHINE'=>0x80000002, 'HKEY_USERS'=>0x80000003, 'HKEY_PERFORMANCE_DATA'=>0x80000004, 'HKEY_PERFORMANCE_TEXT'=>0x80000050, 'HKEY_PERFORMANCE_NLSTEXT'=>0x80000060, 'HKEY_CURRENT_CONFIG'=>0x80000005, 'HKEY_DYN_DATA'=>0x80000006);
$arrBuffer = array();
Consider simplifying this complex logical expression. Open
Open
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
!wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {