Showing 16,700 of 16,700 total issues
Method userHits
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function userHits($start = null, $stop = null, $default = 0)
{
if (empty($this->user_id)) {
$row = $this->db->row(array(
'SELECT',
Method page
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function page()
{
extract(Admin::params('bp', 'page', 'auth', 'path', 'method'));
switch ($method) {
case 'logout':
Method id
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function id($table, $value, array $insert = array())
{
settype($value, 'string');
if (isset(self::$ids[$table][$value])) {
return self::$ids[$table][$value];
Function ids
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static function ids(array $ids, array $snippets = array())
{
$html = '';
extract(Admin::params(array('bp', 'blog', 'page')));
foreach ($blog->info($ids) as $id => $row) {
- 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 sessionCookie
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static function sessionCookie()
{
$page = Page::html();
$now = microtime(true);
$time = floor($now);
- 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 extractFolders
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function extractFolders($folders, $allow_extensions = null)
{
$file_locations = array();
foreach ((array) $folders as $folder) {
foreach ($this->files() as $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 __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $enable = array(), array $messages = array())
{
if (self::$debugbar) {
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 create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static function create()
{
$html = '';
extract(Admin::params('bp', 'page', 'blog'));
$form = $bp->form('admin_theme_create');
- 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
Method iterate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function iterate($path, $recursive = false, $types = null)
{
$dirs = $files = array();
if (is_dir($path)) {
$cut = strlen($path);
Method setup
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setup($auth, $path)
{
extract(Admin::params('bp', 'page'));
static::$icon = $bp->icon('user', 'glyphicon', 'span style="margin-right:10px;"').' ';
if ($user = $auth->http()) {
Method getCookieHeader
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly)
{
$cookie = sprintf('%s=%s', $name, urlencode($value));
if (0 !== $expires) {
Method collect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function collect()
{
$messages = array();
$files = array_values(DebugBar::get('files'));
$offset = 0;
Method login
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function login($user_id, $expires = 7200, $single = false)
{
if (empty($user_id)) {
return;
}
Function convert
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function convert($value, $unit = null)
{
if (is_null($unit)) {
return array(
'km' => $this->convert($value, 'km'),
- 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 collect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function collect()
{
$time = DebugBar::$debugbar->hasCollector('time') ? DebugBar::$debugbar['time'] : false;
$templates = Theme::$templates;
$data = array(
- 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 image
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private static function image($path, $eject = '')
{
$html = '';
$imagick = (extension_loaded('imagick') && class_exists('Imagick')) ? true : false;
$types = array('jpg', 'gif', 'png');
- 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 collect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function collect()
{
// return array();
$responseHeaders = $this->response->headers->all();
- 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 collect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function collect()
{
$messages = array();
$files = array_values(DebugBar::get('files'));
$offset = 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 mkpath
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function mkpath($dir)
{
$path = $this->dir.$dir;
if (!is_dir($path)) {
$str = '';
- 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
Method uncompress
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function uncompress($content, $mode, $uncompressed_size, $target_file_name)
{
switch ($mode) {
case 0:
return ($target_file_name) ? file_put_contents($target_file_name, $content) : $content;