Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — master (#61)
by Oliver
02:35
created

UniquePages::about_us()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 9
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
trait UniquePages
6
{
7
    /*
8
    |--------------------------------------------------------------------------
9
    | Unique pages for Backpack\PageManager
10
    |--------------------------------------------------------------------------
11
    |
12
    | Each unique page has its own method, that define what fields should show up using the Backpack\CRUD API.
13
    | Use snake_case for naming and PageManager will generate the page on first edit
14
    |
15
    | Any fields defined here will show up after the standard page fields:
16
    | - select template (hidden and fix)
17
    | - page name (only seen by admins) (hidden and fix)
18
    | - page title
19
    | - page slug (hidden and fix, slug of method name)
20
    */
21
22 View Code Duplication
    private function about_us()
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
23
    {
24
        $this->crud->addField([
0 ignored issues
show
Bug introduced by
The property crud does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
25
            'name' => 'content',
26
            'label' => trans('backpack::pagemanager.content'),
27
            'type' => 'wysiwyg',
28
            'placeholder' => trans('backpack::pagemanager.content_placeholder'),
29
        ]);
30
    }
31
32 View Code Duplication
    private function some_thing()
0 ignored issues
show
Unused Code introduced by
This method is not used, and could be removed.
Loading history...
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Coding Style introduced by
This method is not in camel caps format.

This check looks for method names that are not written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes databaseConnectionSeeker.

Loading history...
33
    {
34
        $this->crud->addField([
35
            'name' => 'content',
36
            'label' => trans('backpack::pagemanager.content'),
37
            'type' => 'simplemde',
38
            'placeholder' => trans('backpack::pagemanager.content_placeholder'),
39
        ]);
40
    }
41
}
42