Function requireJs
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function requireJs()
{
$scripts = $this->dispatcher->scripts('script', $this->assets, $this->path);
$required = [];
- Read upRead up
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 add
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function add($name, $source, $dependencies = [], $attributes = [], $replaces = [])
{
if (!is_null($from = array_get($attributes, 'from')) && !is_null($extension = extensions($from))) {
$extensions = app('antares.extension')->getAvailableExtensions();
$path = null;
- Read upRead up
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 webpack
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function webpack()
{
$scripts = array_merge(['/packages/core/js/on-load.js', '/packages/core/js/datatable-helpers.js'], $this->dispatcher->scripts('script', $this->assets, $this->path));
Function webpack
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function webpack()
{
$scripts = array_merge(['/packages/core/js/on-load.js', '/packages/core/js/datatable-helpers.js'], $this->dispatcher->scripts('script', $this->assets, $this->path));
- Read upRead up
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 register
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function register($type, $name, $source, $dependencies, $attributes, $replaces)
Method style
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function style($name, $source, $dependencies = [], $attributes = [], $replaces = [])
Method script
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function script($name, $source, $dependencies = [], $attributes = [], $replaces = [])
Method inlineScript
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function inlineScript($name, $source = null, $dependencies = [], $attributes = [], $replaces = [])
Method add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function add($name, $source, $dependencies = [], $attributes = [], $replaces = [])