Showing 71 of 530 total issues
Method actionSettings
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionSettings()
{
$model = new FormModel([
'keys' => [
'frontend.maintenance' => [
Method generateRelations
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateRelations()
{
if ($this->generateRelations === self::RELATIONS_NONE) {
return [];
}
Function success
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function(result){
$.each(result, function(k,v){
if(data[k] == undefined){
var sample = [];
for(var i = 1; i <= setLength; i++){
Function success
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function(result){
$.each(result, function(k,v){
if(data[k] == undefined){
var sample = [];
for(var i = 1; i <= setLength; i++){
Function success
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function(result){
if(!data){
data = [];
for(var i = 1; i <= setLength; i++){
data.push([i, 0])
Function success
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function(result){
if(!data){
data = [];
for(var i = 1; i <= setLength; i++){
data.push([i, 0])
Method run
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
$model = $this->model;
$form = call_user_func([$this->formClass, 'begin'], $this->formOptions);
foreach ($model->keys as $key => $config) {
Function init
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function init()
{
if (!$this->key) {
throw new InvalidConfigException;
}
- 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 checkJunctionTable
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function checkJunctionTable($table)
{
if (count($table->foreignKeys) < 2) {
return false;
}
- 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 generateClassName
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function generateClassName($tableName, $useSchemaName = null)
{
if (isset($this->classNames[$tableName])) {
return $this->classNames[$tableName];
}
- 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 save
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
if ($this->validate()) {
$model = $this->getModel();
$isNewRecord = $model->getIsNewRecord();
- 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 save
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function save()
{
if ($this->validate()) {
$model = $this->getModel();
$isNewRecord = $model->getIsNewRecord();
- 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 actionMigrate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function actionMigrate($inputConfigFile, $outputConfigFile)
{
$inputConfigFile = \Yii::getAlias($inputConfigFile);
if (!is_file($inputConfigFile)) {
throw new \Exception("The configuration file does not exist: $inputConfigFile");
- 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 getTableNames
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function getTableNames()
{
if ($this->tableNames !== null) {
return $this->tableNames;
}
- 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 behaviors
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
Method safeDown
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function safeDown()
{
$this->delete('{{%key_storage_item}}', [
'key' => 'frontend.maintenance'
]);
Method rules
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rules()
{
return [
['username', 'filter', 'filter' => 'trim'],
['username', 'required'],
Method actionSignup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionSignup()
{
$model = new SignupForm();
if ($model->load(\Yii::$app->request->post())) {
$user = $model->signup();
Method init
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
if (!$this->key) {
throw new InvalidConfigException;
}
Method hints
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hints()
{
return array_merge(parent::hints(), [
'ns' => 'This is the namespace of the ActiveRecord class to be generated, e.g., <code>app\models</code>',
'db' => 'This is the ID of the DB application component.',