Showing 70 of 70 total issues
Method readAdminSettings
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readAdminSettings($fileName = null){
if ($fileName === null) { $fileName = $this->fileName; }
if (file_exists($fileName)){
require $fileName;
if (!isset($settings)||!is_array($settings)){
Method process
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(){
if (!isset($this->request['collection'])){
throw new Exception(
'The request does not contain a collection.',
Function processFail
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function processFail(request,responseText,status,subtitle){
"use strict";
var data, response;
if(
status === 404 &&
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$client_id = null,
$client_secret = null,
$redirect_uri = null,
$adminId = null,
$accessToken = null,
Function formatDateTimeString
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatDateTimeString(dateTimeString){
"use strict";
var dateParts = dateTimeString.split(' '),
timeParts = dateParts[1].split(':'),
dateDateParts = dateParts[0].split('-'),
Function requestAndProcessPageJSONData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function requestAndProcessPageJSONData(request){
"use strict";
var xmlhttp, //intervalID = window.setInterval(processingDots,1000),
spinnerSettings, spinner, params, subtitle;
if (request.hasOwnProperty('subtitle')){
- 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 processUserAction
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function processUserAction($request = null){
if ($request === null){
$request = $this->request;
}
- 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 authenticate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function authenticate($client = null, $code = null, $token = null){
if ($client === null) { $client = $this->client; }
if ($token===null){ $token = $this->token; }
- 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 getFilteredDataFromTable
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getFilteredDataFromTable(
$tableIdOrName,
$raffleId = null,
$id = null
){
Consider simplifying this complex logical expression. Open
if (
// not signing in
(
!isset($_REQUEST['collection'])
||(
Method addRaffle
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$description,
$userId,
$created = null,
$privacy = null,
$status = null,
Method __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$client_id,
$client_secret,
$redirect_uri,
$token = null,
$code = null,
Method getRaffles
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$raffleId = null,
$description = null,
$creatorId = null,
$participantId = null,
$winnerId = null,
Avoid deeply nested control flow statements. Open
if (typeof data.data.rows[index][propertyName] !== 'undefined') {
//noinspection JSUnfilteredForInLoop
switch (data.data.columns[propertyName]){
case 'raffleid':
//noinspection JSUnfilteredForInLoop
Function updateStatus
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function updateStatus(
$raffleId,
$status,
$userId = null,
$isAdmin = null,
- 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 addParticipant
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$userId,
$raffleId,
$comment = null,
$joined = null,
$tableId = null,
Consider simplifying this complex logical expression. Open
if (
isset($result->columns)&&
is_array($result->columns)&&
$result->columns[0]==='rowid'&&
isset($result->rows)&&
Method addWinner
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$userId,
$raffleId,
$raffled,
$tableId = null,
$fusionTablesService = null
Method setClient
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$accessToken = null,
$client_id = null,
$client_secret = null,
$redirect_uri = null,
$client = null
Method updateStatus
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$raffleId,
$status,
$userId = null,
$isAdmin = null,
$raffleDAO = null