Showing 203 of 203 total issues
Function load
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function load()
{
$this->fileName = $this->settings->path;
if (file_exists($this->fileName)) {
- 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 delete
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function delete($key)
{
if (is_array($key)) {
$kk = & $this->data;
$lastKey = 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
Method makeAnchor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeAnchor(array $properties)
{
if (!$properties) {
throw new Command\Exception('Unable to make anchor, no properties');
}
Method parseResponseCookies
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseResponseCookies()
{
$cookies = array();
$this->parsedHeaders = array();
foreach ($this->responseHeaders as $hdr) {
Method prepareCommand
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function prepareCommand(Command\Definition $definition)
{
$commandClass = $definition->commandClass;
/** @var Command $command */
Method getUsage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getUsage() {
$usage = '';
if (!$this->isUnnamed) {
if ($this->shortName) {
$usage = Runner::OPTION_SHORT . $this->shortName;
Method echoLines
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function echoLines()
{
foreach ($this->lines as $rowIndex => $rowData) {
foreach ($rowData as $lineIndex => $row) {
$line = '';
Method readForeignKeys
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readForeignKeys(Table $def) {
$res = $this->database
->select()
->select('tc.constraint_name, kcu.column_name')
->select('ccu.table_name AS foreign_table_name, ccu.column_name AS foreign_column_name')
Method render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render()
{
$def = $this->command->definition();
$bashFunction = str_replace('-', '_', $def->name);
Function makeDefinitionsTree
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function makeDefinitionsTree(Definition $definition)
{
foreach ($definition->optionsArray() as $option) {
if ($option->type === Option::TYPE_ENUM) {
foreach ($option->enumValues as $enumName => $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 getTypeByString
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getTypeByString($type) {
$phpType = Column::STRING;
$type = strtoupper($type);
switch (true) {
case 'BIGINT' === substr($type, 0, 6):
- 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 getName
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getName() {
if (null === $this->name) {
$this->name = 'fk';
foreach ($this->localColumns as $column) {
$this->name .= '_' . $column->table->schemaName;
- 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 buildSelect
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function buildSelect(Quoter $quoter)
{
$columns = '';
if ($this->select) {
foreach ($this->select as $column) {
- 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 query
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function query($statement = null, $binds = null)
{
if ($statement instanceof Batch) {
$statements = $statement->get();
}
- 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 keyExists
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function keyExists($key)
{
if (is_array($key)) {
$kk = & $this->data;
foreach ($key as $k) {
- 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 get
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function get($key)
{
if (is_array($key)) {
$kk = & $this->data;
foreach ($key as $k) {
- 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 set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function set($expression, $binds = null)
{
if (null === $expression) {
return $this;
}
- 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 getStatementTokenizer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getStatementTokenizer() {
if (null === $this->tokenizer) {
$this->tokenizer = $tokenizer = new Lexer\Parser();
$tokenizer
Method initOptions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function initOptions()
{
foreach ($this->optionsArray as $name => $option) {
if ($option instanceof Option) {
if ($option->isUnnamed || $option->isRequired) {
Method __toString
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __toString()
{
// http://user:password@host:port/path?query
$result = $this->scheme;