Showing 151 of 151 total issues
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'subtitle' => htmlspecialchars(strip_tags($this->subtitle), ENT_COMPAT, 'UTF-8'),
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'namespaces' => $this->namespaces
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
$config_file => config_path('feed.php')
- Exclude checks
Line indented incorrectly; expected at least 8 spaces, found 6 Open
'lang' => $this->lang,
- Exclude checks
Closing brace indented incorrectly; expected 205 spaces, found 0 Open
} ?>>
- Exclude checks
The variable $config_file is not named in camelCase. 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
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
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
Call to method put
from undeclared class \Illuminate\Contracts\Cache\Repository
Open
$this->cache->put($this->cacheKey."_ctype", $ctype, $this->caching);
- Exclude checks
Call to method make
from undeclared class \Illuminate\Contracts\Routing\ResponseFactory
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 possibly unextractable annotation for a fragment of comment '* @param string/integer $date':
after string,
did not see an element name (will guess based on comment order) Open
* @param string/integer $date
- Exclude checks
Variable $namespaces
is undeclared Open
<feed xmlns="http://www.w3.org/2005/Atom"<?php foreach ($namespaces as $n) {
- Exclude checks
Rename "$ctype" which has the same name as the field declared at line 145. Open
$ctype = $this->ctype;
- Read upRead up
- Exclude checks
Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.
Noncompliant Code Example
class Foo { public $myField; public function doSomething() { $myField = 0; ... } }
See
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Call to method get
from undeclared class \Illuminate\Contracts\Config\Repository
Open
$this->link = $this->configRepository->get('application.url');
- Exclude checks
Property \Laravelium\Feed\Feed->response
has undeclared type \Illuminate\Contracts\Routing\ResponseFactory
Open
protected $response = null;
- Exclude checks
Call to method make
from undeclared class \Illuminate\Contracts\Routing\ResponseFactory
Open
return $this->response->make($this->view->make($view, $viewData), 200, ['Content-Type' => $ctype.'; charset='.$this->charset]);
- Exclude checks
Parameter $app
has undeclared type \Illuminate\Contracts\Container\Container
Open
$this->app->bind('feed', function (Container $app) {
- Exclude checks
Suspicious array access to \Illuminate\Contracts\Container\Container
Open
'cache' => $app['Illuminate\Cache\Repository'],
- Exclude checks
Define a constant instead of duplicating this literal "; charset=" 3 times. Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- 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.
Define a constant instead of duplicating this literal "_ctype" 3 times. Open
return $this->response->make($this->cache->get($this->cacheKey), 200, ['Content-Type' => $this->cache->get($this->cacheKey."_ctype").'; charset='.$this->charset]);
- 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.