File Users.php
has 396 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace BootPress\Admin\Pages;
use BootPress\Admin\Component as Admin;
Method listUsers
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function listUsers($view)
{
extract(Admin::params('bp', 'page', 'auth', 'website'));
$page->title = 'View Users at '.$website;
$html = '';
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 = '';
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 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 = '';
Method signIn
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function signIn()
{
extract(Admin::params('bp', 'page', 'auth', 'path'));
$page->title = 'Sign In for Admin Users';
$html = '';
Function page
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function page()
{
extract(Admin::params('bp', 'page', 'auth', 'path', 'method'));
switch ($method) {
case 'logout':
- 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 registerUser
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function registerUser()
{
extract(Admin::params('bp', 'page', 'auth', 'path', 'website'));
$page->title = 'Register User at '.$website;
$html = '';
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 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()) {
Function editUser
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static function editUser($user_id)
{
extract(Admin::params('bp', 'page', 'auth', 'website'));
$page->title = 'Edit User 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 sessions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function sessions($user_id)
{
extract(Admin::params('bp', 'page', 'auth'));
$html = '';
if (!$bp->pagination->set('sessions', 10)) {
- 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 signIn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function signIn()
{
extract(Admin::params('bp', 'page', 'auth', 'path'));
$page->title = 'Sign In for Admin Users';
$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 editProfile
has a Cognitive Complexity of 7 (exceeds 5 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 = '';
- 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"