Showing 6 of 8 total issues
Function request
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
protected function request($method, $url, $meta = null)
{
$client = $this->getClient();
$method = strtoupper($method);
$meta = is_array($meta) ? $meta : [];
- 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 request
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function request($method, $url, $meta = null)
{
$client = $this->getClient();
$method = strtoupper($method);
$meta = is_array($meta) ? $meta : [];
Method parseNode
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseNode($node, $formattedUser = null)
{
$formattedUser = !empty($formattedUser) ? $formattedUser : null;
if (!empty($node['owner']) && is_null($formattedUser)) {
$formattedUser = $node['owner'];
Function parseNode
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function parseNode($node, $formattedUser = null)
{
$formattedUser = !empty($formattedUser) ? $formattedUser : null;
if (!empty($node['owner']) && is_null($formattedUser)) {
$formattedUser = $node['owner'];
- 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 requestData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function requestData($method, $url, $pageKey, $typeKey, $limit = null)
Function getSharedData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getSharedData($response)
{
if (!$response['status']) {
throw new \RuntimeException('service is unavailable now');
}
- 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"