File RaffleDAO.php
has 498 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* gplusraffle - Google API PHP OAuth 2.0 and FusionTables client based raffle
* management system
*
Method pickWinners
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pickWinners(
$raffleId,
$limit = null,
$raffled = null,
$tableId = null,
Method addRaffle
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addRaffle(
$description,
$userId,
$created = null,
$privacy = null,
Method getRaffles
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRaffles(
$raffleId = null,
$description = null,
$creatorId = null,
$participantId = null,
Function getRaffles
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getRaffles(
$raffleId = null,
$description = null,
$creatorId = null,
$participantId = 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
Function addRaffle
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function addRaffle(
$description,
$userId,
$created = null,
$privacy = 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
Function getResultsForRaffleId
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getResultsForRaffleId(
$raffleId,
$tableId = null,
$userIdAndIdField = null,
$fusionTablesService = 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
Function pickWinners
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function pickWinners(
$raffleId,
$limit = null,
$raffled = null,
$tableId = 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 getResultsForRaffleId
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getResultsForRaffleId(
$raffleId,
$tableId = null,
$userIdAndIdField = null,
$fusionTablesService = null
Method deleteRaffle
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteRaffle(
$raffleId,
$tableIds = null,
$fusionTablesService = null
){
Method getFilteredDataFromTable
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getFilteredDataFromTable(
$tableIdOrName,
$raffleId = null,
$id = null
){
Method addRaffle
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$description,
$userId,
$created = null,
$privacy = null,
$status = null,
Method getRaffles
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$raffleId = null,
$description = null,
$creatorId = null,
$participantId = null,
$winnerId = null,
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 pickWinners
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$raffleId,
$limit = null,
$raffled = null,
$tableId = null,
$fusionTablesService = null
Function updateRaffleStatus
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function updateRaffleStatus(
$raffleId,
$status,
$tableId = null,
$fusionTablesService = 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
Function deleteRaffle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function deleteRaffle(
$raffleId,
$tableIds = null,
$fusionTablesService = 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
Function deleteParticipant
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function deleteParticipant(
$userId,
$raffleId,
$tableId = null,
$fusionTablesService = 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"