Showing 12 of 12 total issues
Method fakeColumn
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function fakeColumn($fakeName, $fakeType, $maxLength)
{
switch ($fakeType) {
case self::NUMERIC:
$result = $this->faker->fake(array('Integer' => array('length' => mt_rand(6, 8))))->num(1);
Function fakeColumn
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function fakeColumn($fakeName, $fakeType, $maxLength)
{
switch ($fakeType) {
case self::NUMERIC:
$result = $this->faker->fake(array('Integer' => array('length' => mt_rand(6, 8))))->num(1);
- 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 run
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
if ($this->help) {
return $this->showHelp();
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public function __construct($options = null)
{
if (is_array($this->getDefaultOptions())) {
$defaultOptions = $templateOptions = array_merge(array('generatedBy' => null), $this->getDefaultOptions());
} else {
Function __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
final public function __construct($options = null)
{
if (is_array($this->getDefaultOptions())) {
$defaultOptions = $templateOptions = array_merge(array('generatedBy' => null), $this->getDefaultOptions());
} else {
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
if ($this->help) {
return $this->showHelp();
- 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 generate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function generate()
{
$chars = self::CHARS;
$addChars = $this->getOption('addChar');
if ($addChars !== null) {
- 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 xml2array
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function xml2array($xmlObject, $out = array())
{
foreach ($xmlObject->attributes() as $attr => $val) {
$out['@attributes'][$attr] = (string)$val;
}
- 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 fill
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function fill()
{
$totalColumn = $this->db->getTotalColumns();
$rows = array();
for ($n = 0; $n < $this->num; $n++) {
- 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 process
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function process($data)
{
/**
* When an element in the configuration is not present,
* FakerinoConf returns an exception.
- 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 generateIntegerFrom
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function generateIntegerFrom($type, $length, $negative)
{
$fakeInteger = 0;
switch ($type) {
case Integer::DECIMAL:
- 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 process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function process($data)
{
$elementName = $data->getName();
$options = $data->getOptions();
$expr = null;
- 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"