Showing 67 of 67 total issues
Method loadProperMessageTemplateBy
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadProperMessageTemplateBy($code)
{
switch ($code) {
case Emails::USER_CONFIRMATION:
$message = $this->templatesService->fetchTemplate(
Method sidebar
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sidebar(PluginHooksEvent $event)
{
$user = $this->userService->getCurrentUser();
if (!$this->pluginsService->isEnabled(LifecycleSubscriber::PLUGIN_NAME) || !$user->hasPermission(Permissions::SIDEBAR)) {
return;
Method onMenuConfigure
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onMenuConfigure(ConfigureMenuEvent $event)
{
$menu = $event->getMenu();
$labelPlugins = $this->translator->trans('Plugins');
$labelPluginName = $this->translator->trans('paywall.title');
Function durationAction
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function durationAction(Request $request, $id = null)
{
$em = $this->getDoctrine()->getManager();
$duration = new Duration();
$form = $this->createForm(new DurationType(), $duration);
- 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 batchOrderAction
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function batchOrderAction(Request $request, $currency)
{
$items = $request->request->get('batchorder', array());
$response = new JsonResponse();
if (empty($items)) {
Function installAdapters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function installAdapters()
{
if (!isset($this->config['gateways'])) {
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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($em, $dispatcher, $scheduler, $systemPreferences, $pluginsService, $translator)
Function getListByCriteria
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getListByCriteria($criteria, $returnQuery = false)
{
$qb = $this->createQueryBuilder('s');
$qb->select('s', 'r', 'd')
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
EmailService $emailService,
SystemPreferencesService $systemPreferences,
TemplatesService $templatesService,
PlaceholdersService $placeholdersService,
EntityManager $em,
Function createItemAction
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function createItemAction(Request $request, Order $order)
{
$this->hasPermission(Permissions::ORDERS_MANAGE);
$em = $this->get('em');
$activeOnes = $this->getActiveSubscriptions($request->getLocale());
- 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 __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
OrderService $orderService,
PaymentService $paymentService,
GatewayAdapter $adapter,
EntityManager $entityManager,
EventDispatcherInterface $dispatcher
Method getExpiringSubscriptions
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getExpiringSubscriptions($offset, $batch, $now, $notify, $days = 7)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$templating,
$entityManager,
$templatesProvider,
$pluginsService,
$userService
Function findActiveBy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function findActiveBy($locale = null, $specs = array())
{
$queryBuilder = $this
->createQueryBuilder('s')
->select('s', 'r')
- 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 getErrorMessages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getErrorMessages(\Symfony\Component\Form\Form $form)
{
$errors = array();
if (count($form) > 0) {
foreach ($form->all() as $child) {
- 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 __construct
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($subscription = null)
{
if (!$subscription instanceof UserSubscription) {
$em = \Zend_Registry::get('container')->getService('em');
if (!$subscription) {
- 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 createAction
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function createAction(Request $request)
{
$this->hasPermission(Permissions::CURRENCIES_MANAGE);
$currency = $this->getRepository()->createNew();
$form = $this->createForm(new CurrencyType(), $currency);
- 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 loadProperMessageTemplateBy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function loadProperMessageTemplateBy($code)
{
switch ($code) {
case Emails::USER_CONFIRMATION:
$message = $this->templatesService->fetchTemplate(
- 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 filterMySubscriptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function filterMySubscriptions(array $items = array())
{
$orderItems = new ArrayCollection($items);
foreach ($orderItems as $item) {
foreach ($orderItems as $value) {
- 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 createAction
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function createAction(Request $request)
{
$this->hasPermission(Permissions::DISCOUNTS_MANAGE);
$discount = new Discount();
$form = $this->createForm(new DiscountType(), $discount);
- 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"