Showing 17 of 109 total issues
Method createCloud
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createCloud($type, InputInterface $input)
{
Assert::oneOf($type, array('from-url', 'from-file'), 'Invalid type for createCloud: ' . $type);
$stopwatch = new Stopwatch();
Function searchPlace
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function searchPlace(Box $bounds, Box $box)
{
$this->logger->log(' Search place for ' . $box, Logger::DEBUG);
- 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 searchPlace
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function searchPlace(Box $bounds, Box $box)
{
$this->logger->log(' Search place for ' . $box, Logger::DEBUG);
Method configure
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this
// Filters options
->addOption('case', null, InputOption::VALUE_OPTIONAL, 'Change case filter type (uppercase, lowercase, ucfirst)')
Function addWordToMask
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function addWordToMask($word, Box $place, $font, $size, $angle)
{
$base = $this->metrics->calculateSize($word, $font, $size, $angle);
foreach (str_split($word) as $letter) {
$box = $this->metrics->calculateSize($letter, $font, $size);
- 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 drawBoxForText
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawBoxForText($x, $y, $width, $height, $angle, $color = '#000000')
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$imgWidth,
$imgHeight,
PlacerInterface $placer,
FontMetrics $metrics,
$precise = false,
Method getFilterBuilder
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$minWordLength,
$maxWordLength,
$changeCase = null,
$noRemoveNumbers = false,
$noRemoveUnwanted = false,
Method drawText
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawText($x, $y, $text, $size, $color = '#000000', $angle = 0)
Method render
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
CloudBuilder $cloudBuilder,
FontsFactory $factory,
PlacerInterface $placer = null,
$renderBoxes = false,
$renderMask = false
Method drawBox
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawBox($x, $y, $width, $height, $color = '#000000')
Method getBoxForText
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function getBoxForText($x, $y, $width, $height, $angle)
Method addWordToMask
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addWordToMask($word, Box $place, $font, $size, $angle)
Function renderCloud
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function renderCloud()
{
/** @var \SixtyNine\Cloud\Model\CloudWord $word */
foreach ($this->cloud->getWords() as $word) {
- 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 build
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function build($name)
{
$list = new WordsList();
$list->setName($name);
- 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 renderUsher
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function renderUsher(
PlacerInterface $placer,
$color = '#ff0000',
$maxIterations = 5000
) {
- 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 build
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function build()
{
$filters = new Filters();
if (null !== $this->case) {
- 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"