Skip to content

Cyclomatic Complexity Tokens #2

@alixaxel

Description

@alixaxel

I'm not sure if this issue is really a "issue", or if it's just my misconception of cyclomatic complexity, but:

  • if the if + else if tokens are sufficient to get full branch coverage (i.e.: else worth 0), shouldn't the same logic be applied to the default case of switch statements, instead of valuing it as 1?
  • if I have a block of code that looks like this:
try
{
    // something
}

catch (\PDOException $e)
{
    // foo
}

catch (\Exception $e)
{
    // bar
}

Shouldn't try be worth 0 and each catch block be worth 1?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions