Showing 54 of 80 total issues
Function exports
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
Avoid deeply nested control flow statements. Open
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
Avoid deeply nested control flow statements. Open
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
Function exports
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
rawScriptExports,
compiledTemplate,
functionalTemplate,
injectStyles,
scopeId,
Function write
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
write: function write(name, value, expires, path, domain, secure) {
Consider simplifying this complex logical expression. Open
if (moduleIdentifier) { // server build
hook = function (context) {
// 2.3 injection
context =
context || // cached call
Consider simplifying this complex logical expression. Open
if (utils.isFormData(data) ||
utils.isArrayBuffer(data) ||
utils.isBuffer(data) ||
utils.isStream(data) ||
utils.isFile(data) ||
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function createError(message, config, code, request, response) {
Method newPivot
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function newPivot(Eloquent $parent, array $attributes, $table, $exists, $using = null)
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function enhanceError(error, config, code, request, response) {
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
Function update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function update(ItemUpdateRequest $request, Item $item)
{
/** @var \App\Models\User $user */
$user = auth()->user();
if ($item->published()) {
- 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 deleteImage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function deleteImage(Item $item, Image $image)
{
// sanity check first
if (! $item->images->contains($image)) {
abort(404);
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
foreach (static::$content as $slug => $value) {
if (is_numeric($slug)) {
// if we have a raw array, slug the value instead.
- 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"