Showing 144 of 16,700 total issues
File wyciwyg.js
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* From: Alex Brem @ http://blog.0xab.cd - fieldSelection jQuery plugin */
(function() {
var fieldSelection = {
getSelection: function() {
var e = (this.jquery) ? this[0] : this;
Method pages
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function pages()
{
extract(Admin::params('bp', 'website', 'page', 'path', 'admin'));
$page->title = 'Analytic Pages at '.$website;
$url = $page->url($admin, $path, 'users'); // for linking most recent users
Method page
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function page()
{
extract(Admin::params('bp', 'blog', 'auth', 'page', 'admin', 'path', 'method'));
if ($method) {
switch ($method) {
Function collect
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function collect()
{
$logs = array(
'nb_databases' => 0,
'nb_statements' => 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
Method editUser
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function editUser($user_id)
{
extract(Admin::params('bp', 'page', 'auth', 'website'));
$page->title = 'Edit User at '.$website;
$html = '';
Method update
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update($user_id, array $user = array())
{
$update = array();
foreach ($user as $key => $value) {
switch ($key) {
Method __call
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __call($method, $arguments)
{
switch ($method) {
case 'start':
if (self::$debugbar->hasCollector('time')) {
Method restore
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function restore()
{
extract(Admin::params('bp', 'page', 'blog', 'website'));
$page->title = 'Restore Blog at '.$website;
$html = '';
Function listUsers
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private static function listUsers($view)
{
extract(Admin::params('bp', 'page', 'auth', 'website'));
$page->title = 'View Users at '.$website;
$html = '';
- 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 referrers
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function referrers()
{
extract(Admin::params('bp', 'website', 'page'));
$page->title = 'Referrer Analytics at '.$website;
$db = BPA::database();
Method getFileHeader
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getFileHeader($start_offset = false)
{
if ($start_offset !== false) {
fseek($this->fh, $start_offset);
}
Method box
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function box($style, array $contents)
{
$box = '';
$classes = 'box box-'.implode(' box-', explode(' ', $style)); // solid, default, primary, info, warning, success, danger
foreach ($contents as $section => $value) {
Method sessions
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function sessions($user_id)
{
extract(Admin::params('bp', 'page', 'auth'));
$html = '';
if (!$bp->pagination->set('sessions', 10)) {
Method editProfile
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function editProfile($user_id)
{
extract(Admin::params('bp', 'page', 'auth', 'website'));
$page->title = 'Edit Your Profile at '.$website;
$html = '';
Function restore
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private static function restore()
{
extract(Admin::params('bp', 'page', 'blog', 'website'));
$page->title = 'Restore Blog at '.$website;
$html = '';
- 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 debugbar
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function debugbar($action, $params = null)
{
static $debugbar = null;
$params = func_get_args();
$action = (string) array_shift($params);
- 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 setup
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function setup($auth, $path)
{
if (!$auth->isAdmin(2)) {
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
Method setup
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setup($auth, $path)
{
if (!$auth->isAdmin(2)) {
return false;
}
Method create
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function create()
{
$html = '';
extract(Admin::params('bp', 'page', 'blog'));
$form = $bp->form('admin_theme_create');
Method startStop
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function startStop($count, $range, $label = 'Y-m-d H:i:s', array $values = array())
{
$array = array();
$range = substr($range, 0, 3);
if (in_array($range, array('sec', 'min', 'hou', 'day', 'wee', 'mon', 'yea'))) {