Showing 58 of 60 total issues
Method createProject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function createProject($title, $authToken, $description = null, $testing = false, $driver = 'Pg')
Method log
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function log($uri, $method, $params, Response $response = null, $duration = 0)
Function updateMaqlWithMultivalueAttributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function updateMaqlWithMultivalueAttributes(string $maql, array $multivalueAttributes): string
{
$lines = explode("\n", $maql);
foreach ($multivalueAttributes as $fkName => $attribute) {
- 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 getUidFromEmailInProject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getUidFromEmailInProject($email, $pid)
{
foreach ($this->client->getProjects()->getUsersForProjectYield($pid) as $users) {
foreach ($users as $user) {
if (!empty($user['user']['content']['login'])
- 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 listFiles
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function listFiles($folderName, $extensions = [])
{
$result = $this->client->request('PROPFIND', "$folderName/", [
'body' => '<?xml version="1.0"?><d:propfind xmlns:d="DAV:"><d:prop><d:displayname /></d:prop></d:propfind>',
'headers' => [
- 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 cleanForLog
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function cleanForLog($find, $array)
{
if (is_array($array)) {
foreach ($array as $key => $val) {
if (in_array($key, $find)) {
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function create($pid, $name, $attrUri, $operator, $value, $overUri = null, $toUri = null)
{
if (is_array($value)) {
foreach ($value as &$v) {
$v = "[$v]";
- 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 createProject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function createProject($title, $authToken, $description = null, $testing = false, $driver = 'Pg')
{
$result = $this->client->post('/gdc/projects', [
'project' => [
'content' => [
- 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 false;
Avoid too many return
statements within this method. Open
return (int) pow(2, $retries - 1) * 1000;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return (int) pow(2, $retries - 1) * 1000;
Function updateDataSet
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateDataSet($pid, $datasetModel, $dryRun = false)
{
$projectModel = $this->view($pid);
if (!isset($projectModel['projectModel']['datasets'])) {
- 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 isAccessible
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function isAccessible($pid)
{
$projectUri = self::getUriFromPid($pid);
$uid = $this->client->getUsers()->getCurrentUid();
foreach ($this->client->getUsers()->getProjectsYield($uid) as $projects) {
- 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 cancelInvitation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function cancelInvitation($pid, $email)
{
$result = $this->client->get("/gdc/projects/$pid/invitations");
foreach ($result['invitations'] as $r) {
if (strtolower($r['invitation']['content']['email']) != strtolower($email)) {
- 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 updateProject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateProject($pid, $model, $dryRun = false)
{
// Get current GD model
$gdModel = $this->view($pid);
if (!isset($gdModel['projectModel']['datasets'])) {
- 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"