Showing 11 of 14 total issues
File available-locales.php
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
return [
'ace' => ['name' => 'Achinese', 'script' => 'Latn', 'native' => 'Aceh'],
'af' => ['name' => 'Afrikaans', 'script' => 'Latn', 'native' => 'Afrikaans'],
Function save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function save(array $options = array())
{
$tempTranslations = $this->translations;
if ($this->exists) {
if (count($this->getDirty()) > 0) {
- 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
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Authentication $auth, Store $session, Request $request, Redirector $redirect, Application $application)
Function separateLanguages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function separateLanguages($data)
{
$cleanedData = [];
foreach ($data as $key => $value) {
if (is_array($value)) {
- 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 allPublicThemes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function allPublicThemes()
{
$themes = [];
if (!$this->getFinder()->isDirectory($this->path)) {
return $themes;
- 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 too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $this->loadTranslationsFrom($module->getPath() . '/Resources/lang', $moduleName);
Function setLocalesConfigurations
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function setLocalesConfigurations()
{
if (! $this->app['asgard.isInstalled']) {
return;
}
- 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 getValidatorInstance
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getValidatorInstance()
{
$factory = $this->container->make('Illuminate\Validation\Factory');
if (method_exists($this, 'validator')) {
return $this->container->call([$this, 'validator'], compact('factory'));
- 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 registerLanguageNamespace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function registerLanguageNamespace(Module $module)
{
$moduleName = $module->getName();
$langPath = base_path("resources/lang/$moduleName");
- 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 saveTranslatedProperties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function saveTranslatedProperties($model, $data)
{
foreach ($data as $lang => $value) {
if (is_array($value)) {
foreach ($value as $key => $input) {
- 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"