thinkingmedia/phing

View on GitHub

Showing 9 of 11 total issues

Function main has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function main()
    {
        // check supplied attributes
        $this->assertProperty("table", "string");
        $this->assertProperty("order", "file");
Severity: Minor
Found in src/GemsPhing/Database/DatabaseUpdaterTask.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

Method assertProperty has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function assertProperty($name, $type)
    {
        if (empty($name) || !property_exists($this, $name))
        {
            throw new \BuildException("{$name} property does not exist.", $this->location);
Severity: Minor
Found in src/GemsPhing/GemsTask.php - About 1 hr to fix

Function assertProperty has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function assertProperty($name, $type)
    {
        if (empty($name) || !property_exists($this, $name))
        {
            throw new \BuildException("{$name} property does not exist.", $this->location);
Severity: Minor
Found in src/GemsPhing/GemsTask.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 main has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function main()
    {
        // check supplied attributes
        $this->assertProperty("table", "string");
        $this->assertProperty("order", "file");
Severity: Minor
Found in src/GemsPhing/Database/DatabaseUpdaterTask.php - About 1 hr to fix

Method process has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function process($mapFile, $targetURL, Task $task)
    {
        $mapFile = realpath($mapFile);
        if (!file_exists($mapFile))
        {
Severity: Minor
Found in src/GemsPhing/SourceMap.php - About 1 hr to fix

Method getAll has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getAll($dir, $package, array $parts)
    {
        $name = empty($parts)
            ? $package
            : sprintf("%s.%s", implode(".", $parts), $package);
Severity: Minor
Found in src/GemsPhing/Scaffold/ScaffoldClosureTask.php - About 1 hr to fix

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

    public function main()
    {
        if (empty($this->output))
        {
            throw new BuildException("Must specify an output file.", $this->location);
Severity: Minor
Found in src/GemsPhing/Closure/DepsTask.php - About 1 hr to fix

Function main has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function main()
    {
        if (empty($this->root))
        {
            throw new \BuildException("You must specify the root folder, or the root folder does not exist.",
Severity: Minor
Found in src/GemsPhing/Scaffold/DirTreeTask.php - About 55 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 process has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function process($mapFile, $targetURL, Task $task)
    {
        $mapFile = realpath($mapFile);
        if (!file_exists($mapFile))
        {
Severity: Minor
Found in src/GemsPhing/SourceMap.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

Severity
Category
Status
Source
Language