Showing 13 of 30 total issues
FrontendAsset
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class FrontendAsset
{
/**
* The domain for assets.
*
File FrontendAsset.php
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace HnhDigital\LaravelFrontendAssetLoader;
/*
Asset
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Asset
{
private $path;
private $content;
private $location;
Method boot
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot()
{
$this->publishes([
__DIR__.'/../config/config.php' => config_path('hnhdigital/assets.php'),
]);
Function parseExtension
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function parseExtension($path, $location = null)
{
$key = null;
foreach ($this->extension_mapping as $store => $extensions) {
- 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 autoloadAssets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function autoloadAssets($extensions, $path)
{
// Force array.
$extensions = Arr::wrap($extensions);
- 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 autoloadWildcardAssets
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function autoloadWildcardAssets($extensions, $path)
{
// Force array.
$extensions = Arr::wrap($extensions);
- 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 renderInline
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function renderInline($location)
{
$result = '';
$path = $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
Avoid too many return
statements within this method. Open
return '/assets/'.$path;
Avoid too many return
statements within this method. Open
return '';
Avoid too many return
statements within this method. Open
return "<?php app('FrontendAsset')->package($name); ?>";
Avoid too many return
statements within this method. Open
return "<?php app('FrontendAsset')->package($name); ?>";
Function url
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function url($path)
{
// Detect path points to external url.
if (stripos($path, '://') !== false) {
return $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"