Showing 68 of 213 total issues
Method form
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function form(WorkOrder $workOrder, Attachment $attachment)
{
return $this->form->of('work-orders.attachments', function (FormGrid $form) use ($workOrder, $attachment) {
$files = true;
Function block_meta
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Markdown.dialects.Maruku.block.block_meta = function block_meta( block, next ) {
// check if the last line of the block is an meta hash
var m = block.match( /(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/ );
if ( !m ) return undefined;
Function handle
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handle(Filesystem $filesystem)
{
$files = $this->request->file('files');
if (is_array($files)) {
- 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 store
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function store($asset_id, $meter_id)
{
if ($this->meterReadingValidator->passes()) {
$asset = $this->asset->find($asset_id);
$meter = $this->meter->find($meter_id);
- 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 updateEvent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateEvent(calendar, event) {
var form =
$('<form>', {
'method': 'POST',
Function updateEvent
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function updateEvent(calendar, event) {
var form =
$('<form>', {
'method': 'POST',
Method up
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
Schema::create('meters', function (Blueprint $table) {
$table->increments('id');
Method form
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function form(WorkRequest $request)
{
return $this->form->of('work-requests', function (FormGrid $form) use ($request) {
if ($request->exists) {
$method = 'PATCH';
Method store
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store($asset_id, $meter_id)
{
if ($this->meterReadingValidator->passes()) {
$asset = $this->asset->find($asset_id);
$meter = $this->meter->find($meter_id);
Function split_meta_hash
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function split_meta_hash( meta_string ) {
var meta = meta_string.split( "" ),
parts = [ "" ],
in_quotes = false;
Avoid deeply nested control flow statements. Open
for (i = 0; i < stack.length; i++) {
if ( stack[ i ].indent != m[1] ) continue;
list = stack[ i ].list;
stack.splice( i+1 );
found = true;
Function showFormResponse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var showFormResponse = function (response, status, xhr, $form) {
/*
* Check if a message exists
*/
if (typeof response.messageType !== 'undefined') {
- 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 eventResize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
eventResize: function(event, delta, revertFunc, jsEvent, ui, view){
Function getOperator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getOperator($string)
{
$allowed_operators = ['>', '<', '=', '>=', '<='];
$output = preg_split("/[\[\]]/", $string);
- 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 deeply nested control flow statements. Open
if ( --open_parens == 0) {
consumed -= url.length - len;
url = url.substring(0, len);
}
Function eventResize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
eventResize: function(event, delta, revertFunc, jsEvent, ui, view){
Function showFormResponse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var showFormResponse = function (response, status, xhr, $form) {
/*
* Check if a message exists
*/
if (typeof response.messageType !== 'undefined') {
- 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 deeply nested control flow statements. Open
if (!found) {
//print("not found. l:", uneval(l));
wanted_depth++;
if (wanted_depth <= stack.length) {
stack.splice(wanted_depth);
Function response
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function response()
{
if ($this->isAjax()) {
if ($this->errors) {
return $this->responseJson([
- 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 scopeSort
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function scopeSort($query, $field = null, $sort = null)
{
/*
* Make sure both the field and sort variables are present
*/
- 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"