gridonic/hapi

View on GitHub

Showing 33 of 43 total issues

HarvestApi has 110 functions (exceeds 20 allowed). Consider refactoring.
Open

 class HarvestApi
 {
    /**
     *  WAIT
     */
Severity: Major
Found in src/Harvest/HarvestApi.php - About 2 days to fix

    File HarvestApi.php has 802 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Harvest;
    
    use Harvest\Model\Client,
    Severity: Major
    Found in src/Harvest/HarvestApi.php - About 1 day to fix

      Function parseNode has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function parseNode($node)
          {
              $item = null;
              switch ($node->nodeName) {
                  case "expense-category":
      Severity: Minor
      Found in src/Harvest/HarvestApi.php - About 3 hrs 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

      Method parseNode has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function parseNode($node)
          {
              $item = null;
              switch ($node->nodeName) {
                  case "expense-category":
      Severity: Major
      Found in src/Harvest/HarvestApi.php - About 2 hrs to fix

        File HarvestReports.php has 264 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        
        namespace Harvest;
        
        
        Severity: Minor
        Found in src/Harvest/HarvestReports.php - About 2 hrs to fix

          Function getActiveTimers has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function getActiveTimers()
              {
                  $result = $this->getActiveUsers( );
                  if ( $result->isSuccess() ) {
                      $data = array();
          Severity: Minor
          Found in src/Harvest/HarvestReports.php - About 2 hrs 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 performPost has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function performPost($url, $data, $multi = "id")
              {
                  $rData = null;
                  $code = null;
                  $success = false;
          Severity: Minor
          Found in src/Harvest/HarvestApi.php - About 1 hr 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 performGet has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              protected function performGet($url, $multi = true)
              {
                  $data = null;
                  $code = null;
                  $success = false;
          Severity: Minor
          Found in src/Harvest/HarvestApi.php - About 1 hr 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

          Method performPost has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function performPost($url, $data, $multi = "id")
              {
                  $rData = null;
                  $code = null;
                  $success = false;
          Severity: Minor
          Found in src/Harvest/HarvestApi.php - About 1 hr to fix

            Function toURL has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function toURL()
                {
                    $query = "";
                    if(!is_null($this->_page)) {
                        $query .= "&page=" . $this->_page;
            Severity: Minor
            Found in src/Harvest/Model/Invoice/Filter.php - About 45 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 get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function get($property)
                {
                    switch ($property) {
                        case 'code':
                            return $this->_code;
            Severity: Minor
            Found in src/Harvest/Model/Result.php - About 45 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 getUsersActiveTimer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getUsersActiveTimer($user_id)
                {
                    $result = $this->getUserEntries( $user_id, Range::today( $this->_timeZone ) );
                    if ( $result->isSuccess() ) {
                        $data = null;
            Severity: Minor
            Found in src/Harvest/HarvestReports.php - About 45 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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function get($property)
                {
                    switch ($property) {
                        case 'range':
                            return $this->_range;
            Severity: Minor
            Found in src/Harvest/Model/Invoice/Filter.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 getActiveContractors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getActiveContractors()
                {
                    $result = $this->getUsers();
                    if ( $result->isSuccess() ) {
                        $data = array();
            Severity: Minor
            Found in src/Harvest/HarvestReports.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 getActiveAdmins has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getActiveAdmins()
                {
                    $result = $this->getUsers();
                    if ( $result->isSuccess() ) {
                        $data = array();
            Severity: Minor
            Found in src/Harvest/HarvestReports.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 getInactiveAdmins has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getInactiveAdmins()
                {
                    $result = $this->getUsers();
                    if ( $result->isSuccess() ) {
                        $data = array();
            Severity: Minor
            Found in src/Harvest/HarvestReports.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 getInactiveContractors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getInactiveContractors()
                {
                    $result = $this->getUsers();
                    if ( $result->isSuccess() ) {
                        $data = array();
            Severity: Minor
            Found in src/Harvest/HarvestReports.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 set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function set($property, $value)
                {
                    switch ($property) {
                        case 'range':
                            $this->_range = $value;
            Severity: Minor
            Found in src/Harvest/Model/Invoice/Filter.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 $this->_updated_since;
            Severity: Major
            Found in src/Harvest/Model/Invoice/Filter.php - About 30 mins to fix

              Function getActiveClients has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getActiveClients()
                  {
                      $result = $this->getClients();
                      if ( $result->isSuccess() ) {
                          $clients = array();
              Severity: Minor
              Found in src/Harvest/HarvestReports.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