Showing 151 of 151 total issues
Line indented incorrectly; expected at least 8 spaces, found 6 Open
Open
'icon' => $this->icon,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
Open
'ref' => $this->ref,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
Open
'items' => $this->items,
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 4 Open
Open
];
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
Open
$config_file => config_path('feed.php')
- Exclude checks
The variable $config_file is not named in camelCase. Open
Open
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../../views', 'feed');
$this->publishes([
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $config_file is not named in camelCase. Open
Open
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../../views', 'feed');
$this->publishes([
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $config_file is not named in camelCase. Open
Open
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../../views', 'feed');
$this->publishes([
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
Property \Laravelium\Feed\Feed->cache
has undeclared type \Illuminate\Contracts\Cache\Repository
Open
Open
public $cache = null;
- Exclude checks
Property \Laravelium\Feed\Feed->response
has undeclared type \Illuminate\Contracts\Routing\ResponseFactory
Open
Open
protected $response = null;
- Exclude checks
Call to method has
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
Open
if (0 < $this->caching && $this->cache->has($this->cacheKey)) {
- Exclude checks
Call to method get
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- Exclude checks
Call to method make
from undeclared class \Illuminate\Contracts\Routing\ResponseFactory
Open
Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- Exclude checks
Saw an @param annotation for a,
but it was not found in the param list of function addItem(array $item) : void
Open
Open
* @param array $a
- Exclude checks
Call to method get
from undeclared class \Illuminate\Contracts\Config\Repository
Open
Open
$this->lang = $this->configRepository->get('application.language');
- Exclude checks
Call to method put
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
Open
$this->cache->put($this->cacheKey."_ctype", $ctype, $this->caching);
- Exclude checks
Define a constant instead of duplicating this literal "title" 4 times. Open
Open
if (isset($item['title'])) {
- Read upRead up
- Exclude checks
Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.
On the other hand, constants can be referenced from many places, but only need to be updated in a single place.
Noncompliant Code Example
With the default threshold of 3:
function run() { prepare('action1'); // Non-Compliant - 'action1' is duplicated 3 times execute('action1'); release('action1'); }
Compliant Solution
ACTION_1 = 'action1'; function run() { prepare(ACTION_1); execute(ACTION_1); release(ACTION_1); }
Exceptions
To prevent generating some false-positives, literals having less than 5 characters are excluded.
Return type of render()
is undeclared type \Laravelium\Feed\view
Open
Open
public function render($format = null, $cache = null, $key = null)
- Exclude checks
Call to method get
from undeclared class \Illuminate\Contracts\Config\Repository
Open
Open
$this->link = $this->configRepository->get('application.url');
- Exclude checks
Call to undeclared function \request()
Open
Open
$rssLink = (!empty($this->domain)) ? sprintf('%s/%s', rtrim($this->domain, '/'), ltrim(request()->path(), '/')) : request()->url();
- Exclude checks