Showing 318 of 14,363 total issues
Function changeStatusAction
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function changeStatusAction(Request $request, $saveOldPublishedVersion)
{
$facade = $this->get('jms_serializer')->deserialize(
$request->getContent(),
'OpenOrchestra\ApiBundle\Facade\NodeFacade',
- Read upRead up
- Create a ticketCreate a ticket
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 testTransform
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$id,
$contentId,
$contentType,
$name,
$version,
- Create a ticketCreate a ticket
Function userCanUpdateToStatus
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function userCanUpdateToStatus(UserInterface $user, StatusInterface $status, $subject)
{
/** @var GroupInterface $group */
foreach ($user->getGroups() as $group) {
$entityType = $this->getSubjectEntityType($subject);
- Read upRead up
- Create a ticketCreate a ticket
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 submit
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function submit(FormEvent $event)
{
$block = $event->getForm()->getData();
if (null !== $block) {
$blockAttributes = array();
- Read upRead up
- Create a ticketCreate a ticket
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 updateStatus
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function updateStatus(EventStatusableInterface $event)
{
$statusableElement = $event->getStatusableElement();
if (true === $statusableElement->getStatus()->isPublishedState() &&
- Read upRead up
- Create a ticketCreate a ticket
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 duplicateArea
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function duplicateArea(NodeInterface $node, NodeInterface $newNode, $duplicateBlock = true)
{
foreach ($node->getAreas() as $areaId => $area) {
$newArea = clone $area;
$newNode->setArea($areaId, $newArea);
- Read upRead up
- Create a ticketCreate a ticket
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 generateRoutesForNode
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function generateRoutesForNode(NodeInterface $node, ReadSiteInterface $site, array $routePattern)
{
$routes = array();
if (!$node instanceof NodeInterface) {
- Read upRead up
- Create a ticketCreate a ticket
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 addOptionsFormType
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function addOptionsFormType(FieldTypeInterface $data, $type, FormInterface $form)
{
if (is_null($type) || !array_key_exists($type, $this->fieldTypeParameters)) {
return;
}
- Read upRead up
- Create a ticketCreate a ticket
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 refreshLanguagesByAliases
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function refreshLanguagesByAliases(UserInterface $user)
{
$sites = array();
$siteIds = array();
$allSite = $this->get('security.authorization_checker')->isGranted(ContributionRoleInterface::PLATFORM_ADMIN);
- Read upRead up
- Create a ticketCreate a ticket
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 generateStatusesPropertiesMap
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function generateStatusesPropertiesMap(array $statusCollection)
{
$statusMap = array();
foreach ($statusCollection as $index => $status) {
- Read upRead up
- Create a ticketCreate a ticket
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 transform
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function transform($block, array $params = array())
{
if (!$block instanceof BlockInterface) {
throw new TransformerParameterTypeException();
}
- Create a ticketCreate a ticket
Method generateOptions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateOptions()
{
return array(
array(null,
array(
- Create a ticketCreate a ticket
Method provideEntityAndContents
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function provideEntityAndContents()
{
$contentId = 'contentId';
$content = $this->createPhakeContent($contentId);
$contentTypeId = 'contentTypeId';
- Create a ticketCreate a ticket
Method setUp
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUp()
{
$this->routeDocumentClass = 'OpenOrchestra\ModelBundle\Document\RouteDocument';
$this->nodeRepository = Phake::mock('OpenOrchestra\ModelInterface\Repository\NodeRepositoryInterface');
- Create a ticketCreate a ticket
Method setUp
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setUp()
{
$configuration = array(
'open_orchestra_backoffice.role.contribution' => array(
'firstpackage' => array(
- Create a ticketCreate a ticket
Method getConfigTreeBuilder
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('open_orchestra_workflow_admin');
- Create a ticketCreate a ticket
Function listGroup
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
listGroup(page) {
if (null === page) {
page = 1
}
this._displayLoader(Application.getRegion('content'));
- Create a ticketCreate a ticket
Function getBreadcrumb
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
getBreadcrumb() {
return [
{
label:Translator.trans('open_orchestra_workflow_admin.menu.developer.title')
},
- Create a ticketCreate a ticket
Function _copyBlockFromNode
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
_copyBlockFromNode(node) {
let areaId = this._area.get('name');
let area = node.getArea(areaId);
let blocks = area.get('blocks');
let attributes = {
- Create a ticketCreate a ticket
Function exports
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.registerTask('babel:config', 'Open Orchestra task to find and compile es6 scripts', function () {
var config = grunt.config('application.config');
- Create a ticketCreate a ticket