Showing 13 of 13 total issues
Function callCommand
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function callCommand(Command $command)
{
$api = $command->getApi();
$fullUrl = $api->getRequestUrl();
if (!($command instanceof AnonymousCommand)) {
- 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 validateBearerHeader
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validateBearerHeader($header)
{
$bearerData = $this->extractBearerData($header);
$tokenParts = explode('.', $bearerData);
if (count($tokenParts) !== 3) {
Method callCommand
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function callCommand(Command $command)
{
$api = $command->getApi();
$fullUrl = $api->getRequestUrl();
if (!($command instanceof AnonymousCommand)) {
Function validateBearerHeader
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function validateBearerHeader($header)
{
$bearerData = $this->extractBearerData($header);
$tokenParts = explode('.', $bearerData);
if (count($tokenParts) !== 3) {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function get($url, $params = array())
{
if (empty($params)) {
$params = array();
}
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($appId, $appSecret, $apiEndpoint = null, $authEndpoint = null, $openIdEndpoint = null)
Method verify
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function verify($keyInfo, $payload, $signature, $key, $algorithm)
Function doRequest
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function doRequest($type, $url, $params = array())
{
$method = strtoupper($type);
$this->log('>>>>>> ' . $method . ' >>>>>>');
$this->log($url);
- 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
Avoid too many return
statements within this method. Open
return new Security(SkypeBot::getInstance()->getOpenIdKeysProvider());
Avoid too many return
statements within this method. Open
return new Request();
Avoid too many return
statements within this method. Open
return HttpClient::getInstance();
Avoid too many return
statements within this method. Open
return new Dispatcher(SkypeBot::getInstance()->getSecurity());
Function set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function set($key, $value, $xmlSafe = true)
{
$this->validateInput($key, $value);
if ($value instanceof Entity) {
$this->rawObj->{$key} = $value->getRaw();
- 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"