Showing 67 of 67 total issues
Avoid too many return
statements within this method. Open
return array(
'form' => $form->createView(),
'formSpecification' => $formSpecification->createView(),
'subscription_id' => $subscription->getId(),
'ranges' => $subscription->getRanges()->toArray(),
Function countBy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function countBy(array $criteria)
{
$queryBuilder = $this->getEntityManager()->createQueryBuilder()
->select('count(u)')
->from($this->getEntityName(), 'u');
- 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 batchOrderAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function batchOrderAction(Request $request, $currency)
{
$items = $request->request->get('batchorder', array());
$response = new JsonResponse();
if (empty($items)) {
- 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 editAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function editAction(Request $request, Discount $discount)
{
$this->hasPermission(Permissions::DISCOUNTS_MANAGE);
$form = $this->createForm(new DiscountType(), $discount);
$em = $this->get('em');
- 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 sendNotification
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function sendNotification($code, array $recipients = array(), array $data = array())
{
if ($this->systemPreferences->PaywallEmailNotifyEnabled != '1') {
return;
}
- 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 runProcessing
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function runProcessing($now, $daysBefore, $level)
{
$notificationService = $this->getContainer()->getService('newscoop_paywall.notifications_service');
$subscriptionsCount = $notificationService->getExpiringSubscriptionsCount(
$now,
- 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 editAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function editAction(Request $request, Currency $currency)
{
$this->hasPermission(Permissions::CURRENCIES_MANAGE);
$form = $this->createForm(new CurrencyType(), $currency);
$em = $this->get('em');
- 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"