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");
- Read upRead up
- Create a ticketCreate a ticket
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);
- Create a ticketCreate a ticket
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);
- Read upRead up
- Create a ticketCreate a ticket
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");
- Create a ticketCreate a ticket
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))
{
- Create a ticketCreate a ticket
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);
- Create a ticketCreate a ticket
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);
- Create a ticketCreate a ticket
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.",
- Read upRead up
- Create a ticketCreate a ticket
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))
{
- Read upRead up
- Create a ticketCreate a ticket
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"