Showing 15 of 27 total issues
Notification
has 59 functions (exceeds 20 allowed). Consider refactoring. Open
class Notification implements \JsonSerializable
{
/**
* An object which contains specific Pushwoosh notification informations for ADM (Amazon Device Messaging).
*
Function exports
has 148 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.initConfig(
{
File Notification.php
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* gomoob/php-pushwoosh
*
CreateTargetedMessageRequest
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class CreateTargetedMessageRequest extends AbstractRequest
{
/**
* The campaign code to which you want to assign this push message.
*
Android
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Android implements \JsonSerializable
{
/**
* Android application icon badge number.
*
Pushwoosh
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Pushwoosh implements IPushwoosh // NOSONAR
{
/**
* The the Pushwoosh application ID to be used by default by all the requests performed by the Pushwoosh client.
* This identifier can be overwritten by request if needed.
Method jsonSerialize
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonSerialize()
{
$json = [];
// Mandatory parameters
Function checkDeviceType
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function checkDeviceType()
{
// The 'deviceType' parameter must have been defined.
if (!isset($this->deviceType)) {
throw new PushwooshException('The \'deviceType\' property is not set !');
- 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 pushwooshCall
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function pushwooshCall($method, array $data)
{
// Creates the absolute Web Service URL to call, here we first remove trailing '/' characters to be sure the URL
// is well formed
$url = rtrim($this->apiUrl, '/') . '/' . $method;
Method checkDeviceType
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkDeviceType()
{
// The 'deviceType' parameter must have been defined.
if (!isset($this->deviceType)) {
throw new PushwooshException('The \'deviceType\' property is not set !');
Function createMessage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function createMessage(CreateMessageRequest $createMessageRequest)
{
// If both the 'application' and 'applicationsGroup' attribute are not set in the request we try to get a
// default one from the Pushwoosh client
if ($createMessageRequest->getApplication() === null && $createMessageRequest->getApplicationsGroup() === 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 jsonSerialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function jsonSerialize()
{
// One of the 'application' or 'applicationsGroup' parameter must have been defined.
if (!isset($this->application) && !isset($this->applicationsGroup)) {
throw new PushwooshException('None of the \'application\' or \'applicationsGroup\' properties are set !');
- 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 setSendDate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function setSendDate(/* \DateTime */ $sendDate)
{
// Try to parse a string date
if (is_string($sendDate) && $sendDate !== 'now') {
$newSendDate = \DateTime::createFromFormat('Y-m-d H:i', $sendDate);
- 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 setSendDate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function setSendDate(/* \DateTime */ $sendDate)
{
// Try to parse a string date
if (is_string($sendDate) && $sendDate !== 'now') {
$newSendDate = \DateTime::createFromFormat('Y-m-d H:i', $sendDate);
- 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 jsonSerialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function jsonSerialize()
{
$json = [];
// Mandatory parameters
- 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"