Showing 71 of 530 total issues
File Generator.php
has 616 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the HomeFinanceV2 project.
*
* (c) Rafalsky.com <http://github.com/Rafalsky/>
Method safeUp
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function safeUp()
{
$this->insert('{{%user}}', [
'id' => 1,
'username' => 'webmaster',
Function generateRules
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function generateRules($table)
{
$types = [];
$lengths = [];
foreach ($table->columns as $column) {
- 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
Generator
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Generator extends \yii\gii\generators\model\Generator
{
const RELATIONS_NONE = 'none';
const RELATIONS_ALL = 'all';
const RELATIONS_ALL_INVERSE = 'all-inverse';
File common.php
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of the HomeFinanceV2 project.
*
Method generateRules
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateRules($table)
{
$types = [];
$lengths = [];
foreach ($table->columns as $column) {
Method successOAuthCallback
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function successOAuthCallback($client)
{
// use BaseClient::normalizeUserAttributeMap to provide consistency for user attribute`s names
$attributes = $client->getUserAttributes();
$user = User::find()->where([
Method actionReplaceSourceLanguage
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function actionReplaceSourceLanguage($configFile, $newSourceLanguage = false)
{
$config = [
'translator' => 'Yii::t',
'overwrite' => false,
Function generateRelations
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function generateRelations()
{
if ($this->generateRelations === self::RELATIONS_NONE) {
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 successOAuthCallback
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function successOAuthCallback($client)
{
// use BaseClient::normalizeUserAttributeMap to provide consistency for user attribute`s names
$attributes = $client->getUserAttributes();
$user = User::find()->where([
- 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
File index.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Author: Eugine Terentev <eugine@terentev.net>
* @var $this \yii\web\View
* @var $provider \probe\provider\ProviderInterface
User
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends ActiveRecord implements IdentityInterface
{
const STATUS_NOT_ACTIVE = 1;
const STATUS_ACTIVE = 2;
const STATUS_DELETED = 3;
File SignInController.php
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of the HomeFinanceV2 project.
*
Method actionMigrate
has 50 lines of code (exceeds 25 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");
Function update
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(){
$.ajax({
data:{data:"cpu_usage"},
dataType: "json",
success: function(result){
Function update
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(){
$.ajax({
data:{data:"cpu_usage"},
dataType: "json",
success: function(result){
Function actionReplaceSourceLanguage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function actionReplaceSourceLanguage($configFile, $newSourceLanguage = false)
{
$config = [
'translator' => 'Yii::t',
'overwrite' => 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 update
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(){
$.ajax({
data:{data:"memory_usage"},
success: function(result){
if(!data){
Function update
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function update(){
$.ajax({
data:{data:"memory_usage"},
success: function(result){
if(!data){
Method safeUp
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function safeUp()
{
$tableOptions = null;
if ($this->db->driverName === 'mysql') {
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';