keboola/gooddata-php-client

View on GitHub

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')
Severity: Minor
Found in src/Projects.php - About 35 mins to fix

    Method log has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function log($uri, $method, $params, Response $response = null, $duration = 0)
    Severity: Minor
    Found in src/Client.php - About 35 mins to fix

      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) {
      Severity: Minor
      Found in src/ProjectModel.php - About 35 mins to fix

      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'])
      Severity: Minor
      Found in src/Users.php - About 35 mins to fix

      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' => [
      Severity: Minor
      Found in src/WebDav.php - About 35 mins to fix

      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)) {
      Severity: Minor
      Found in src/Client.php - About 35 mins to fix

      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]";
      Severity: Minor
      Found in src/Filters.php - About 35 mins to fix

      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' => [
      Severity: Minor
      Found in src/Projects.php - About 35 mins to fix

      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;
      Severity: Major
      Found in src/Client.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return (int) pow(2, $retries - 1) * 1000;
        Severity: Major
        Found in src/Client.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              return true;
          Severity: Major
          Found in src/WebDav.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                return false;
            Severity: Major
            Found in src/WebDav.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                                  return true;
              Severity: Major
              Found in src/Client.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return (int) pow(2, $retries - 1) * 1000;
                Severity: Major
                Found in src/WebDav.php - About 30 mins to fix

                  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'])) {
                  Severity: Minor
                  Found in src/ProjectModel.php - About 25 mins to fix

                  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) {
                  Severity: Minor
                  Found in src/Projects.php - About 25 mins to fix

                  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)) {
                  Severity: Minor
                  Found in src/Projects.php - About 25 mins to fix

                  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'])) {
                  Severity: Minor
                  Found in src/ProjectModel.php - About 25 mins to fix

                  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

                  Severity
                  Category
                  Status
                  Source
                  Language