gridonic/hapi

View on GitHub

Showing 33 of 43 total issues

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

    public function getContractors()
    {
        $result = $this->getUsers();
        if ( $result->isSuccess() ) {
            $data = 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

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

    public function getClientInactiveProjects($client_id)
    {
        $result = $this->getClientProjects( $client_id );
        if ( $result->isSuccess() ) {
            $projects = 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

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

    public function getActiveUsers()
    {
        $result = $this->getUsers();
        if ( $result->isSuccess() ) {
            $data = 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

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

    public function get($property)
    {
           if ($property == "for_day" || $property == "forDay") {
            return $this->_forDay;
        } elseif ($property == "day_entries" || $property == "dayEntries") {
Severity: Minor
Found in src/Harvest/Model/DailyActivity.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 getAdmins has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAdmins()
    {
        $result = $this->getUsers();
        if ( $result->isSuccess() ) {
            $data = 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

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

    public function getClientActiveProjects($client_id)
    {
        $result = $this->getClientProjects( $client_id );
        if ( $result->isSuccess() ) {
            $projects = 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

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

    public function getInactiveClients()
    {
        $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

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

    public function getProjectTasks($project_id)
    {
        $result = $this->getProjectTaskAssignments($project_id);
        if ($result->isSuccess()) {
            $tasks = 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

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

    public function getActiveProjects()
    {
        $result = $this->getProjects();
        if ( $result->isSuccess() ) {
            $projects = 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

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

    public function getInactiveProjects()
    {
        $result = $this->getProjects();
        if ( $result->isSuccess() ) {
            $projects = 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

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

    public function parseXml($node)
    {
        foreach ($node->childNodes as $item) {
            switch ($item->nodeName) {
                case "tasks":
Severity: Minor
Found in src/Harvest/Model/Project.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 parseXml has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseXml($node)
    {
        foreach ($node->childNodes as $item) {
            switch ($item->nodeName) {
                case "for_day":
Severity: Minor
Found in src/Harvest/Model/DailyActivity.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 getInactiveUsers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getInactiveUsers()
    {
        $result = $this->getUsers();
        if ( $result->isSuccess() ) {
            $data = 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