Showing 11 of 17 total issues
Function query
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
public function query($question, $type = 'A'): Answer
{
$this->clearError();
$typeId = $this->types->getByName($type);
- 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 smartALookup
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function smartALookup($hostname, $depth = 0)
{
$this->debug('SmartALookup for ' . $hostname . ' depth ' . $depth);
// avoid recursive lookups
- 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 readRecord
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function readRecord()
{
// First the pesky domain names - maybe not so pesky though I suppose
$domain = $this->readDomainLabel();
- 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 ShowSection
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function ShowSection(Answer $result)
{
global $extendanswer;
foreach ($result as $index => $record) {
- 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 readDomainLabels
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function readDomainLabels($offset, &$counter = 0)
{
$labels = [];
$startOffset = $offset;
$return = 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 __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($typeId, $type, $class, $ttl, $data, $domain, $string, array $extras)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($server = null, $port = 53, $timeout = 60, $udp = true, $debug = false, $binaryDebug = false)
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return $best_answer->getData();
Avoid too many return
statements within this method. Open
return $result->getData();
Avoid too many return
statements within this method. Open
return $this->smartALookup($newTarget, $depth + 1);