Showing 18 of 18 total issues
Function updateUseOneProperties
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
protected function updateUseOneProperties(\Doctrine\Common\EventArgs $args, PropertyMapping $mapping)
{
$uploadedFile = $mapping->getFileUploadPropertyValue();
//use getOldValue from ORM
- 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
PropertyMapping
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class PropertyMapping
{
protected $obj;
Function execute
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$entityFullName = $input->getOption('entity');
$field = $input->getOption('field');
$force = $input->getOption('force') ? true : false;
- 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 getConfigTreeBuilder
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfigTreeBuilder()
{
$tb = new TreeBuilder();
$root = $tb->root('iphp_file_store');
Function updateSeparateProperties
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function updateSeparateProperties(\Doctrine\Common\EventArgs $args, PropertyMapping $mapping)
{
$uploadedFile = $mapping->getFileUploadPropertyValue();
$currentFileData = $mapping->getFileDataPropertyValue();
$previousFileData = $this->dataStorage->previusFieldDataIfChanged($mapping->getFileDataPropertyName(), $args);
- 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 upload
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upload(PropertyMapping $mapping, File $file)
{
$originalName = $this->getOriginalName($file);
$mimeType = $this->getMimeType($file);
Function getMappingFromField
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getMappingFromField($obj, \ReflectionClass $class, $field, $allFields = true)
{
if (!$this->hasAnnotations($class)) return null;
$annotation = $this->driver->readUploadableField($class, $field);
- 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 execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$entityFullName = $input->getOption('entity');
$field = $input->getOption('field');
$force = $input->getOption('force') ? true : false;
Method updateUseOneProperties
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function updateUseOneProperties(\Doctrine\Common\EventArgs $args, PropertyMapping $mapping)
{
$uploadedFile = $mapping->getFileUploadPropertyValue();
//use getOldValue from ORM
Function useDirectoryNamer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function useDirectoryNamer($fileName, $clientOriginalName)
{
$path = '';
if ($this->hasDirectoryNamer()) {
- 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($path = null, $originalName = null, $mimeType = null,
$size = null, $error = null, $test = false)
Function reverseTransform
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function reverseTransform($fileDataFromForm)
{
//if file field != file upload field - no need to store 'delete' in serialized file data
if (isset($fileDataFromForm['delete']) && !$fileDataFromForm['delete'])
unset($fileDataFromForm['delete']);
- 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 upload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function upload(PropertyMapping $mapping, File $file)
{
$originalName = $this->getOriginalName($file);
$mimeType = $this->getMimeType($file);
- 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 rename
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function rename($serviceName, $method, PropertyMapping $propertyMapping, $fileName, $args = array())
Function readUploadable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function readUploadable(\ReflectionClass $class)
{
$baseClassName = $className = $class->getNamespaceName() . '\\' . $class->getName();
do {
if (isset($this->uploadedClass[$className])) {
- 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 postFlush
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function postFlush(EventArgs $args)
{
if (!$this->deferredFiles) return;
foreach ($this->deferredFiles as $obj) {
- 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 propertyRename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function propertyRename(PropertyMapping $propertyMapping, $fileName, $params)
{
if (isset($params['use_field_name']) && $params['use_field_name'])
return $propertyMapping->getFileDataPropertyName();
- 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 preSet
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function preSet(FormEvent $event)
{
$form = $event->getForm();
$propertyName = $form->getName();
- 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"