Rafalsky/HomeFinance

View on GitHub

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' => [
Severity: Minor
Found in backend/controllers/SiteController.php - About 1 hr to fix

    Method generateRelations has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function generateRelations()
        {
            if ($this->generateRelations === self::RELATIONS_NONE) {
                return [];
            }
    Severity: Minor
    Found in backend/modules/gii/models/Generator.php - About 1 hr to fix

      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++){
      Severity: Minor
      Found in wallet/web/js/system-information/index.js - About 1 hr to fix

        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++){
        Severity: Minor
        Found in backend/web/js/system-information/index.js - About 1 hr to fix

          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])
          Severity: Minor
          Found in backend/web/js/system-information/index.js - About 1 hr to fix

            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])
            Severity: Minor
            Found in wallet/web/js/system-information/index.js - About 1 hr to fix

              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) {
              Severity: Minor
              Found in common/components/keyStorage/FormWidget.php - About 1 hr to fix

                Function init has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function init()
                    {
                        if (!$this->key) {
                            throw new InvalidConfigException;
                        }
                Severity: Minor
                Found in common/widgets/DbCarousel.php - About 1 hr to fix

                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;
                        }
                Severity: Minor
                Found in backend/modules/gii/models/Generator.php - About 1 hr to fix

                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];
                        }
                Severity: Minor
                Found in backend/modules/gii/models/Generator.php - About 1 hr to fix

                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();
                Severity: Minor
                Found in backend/models/UserForm.php - About 1 hr to fix

                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();
                Severity: Minor
                Found in wallet/models/UserForm.php - About 1 hr to fix

                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");
                Severity: Minor
                Found in console/controllers/ExtendedMessageController.php - About 1 hr to fix

                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;
                        }
                Severity: Minor
                Found in backend/modules/gii/models/Generator.php - About 1 hr to fix

                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(),
                Severity: Minor
                Found in frontend/modules/user/controllers/SignInController.php - About 1 hr to fix

                  Method safeDown has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function safeDown()
                      {
                          $this->delete('{{%key_storage_item}}', [
                              'key' => 'frontend.maintenance'
                          ]);
                  Severity: Minor
                  Found in common/migrations/db/m150725_192740_seed_data.php - About 1 hr to fix

                    Method rules has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function rules()
                        {
                            return [
                                ['username', 'filter', 'filter' => 'trim'],
                                ['username', 'required'],
                    Severity: Minor
                    Found in frontend/modules/user/models/AccountForm.php - About 1 hr to fix

                      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();
                      Severity: Minor
                      Found in frontend/modules/user/controllers/SignInController.php - About 1 hr to fix

                        Method init has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function init()
                            {
                                if (!$this->key) {
                                    throw new InvalidConfigException;
                                }
                        Severity: Minor
                        Found in common/widgets/DbCarousel.php - About 1 hr to fix

                          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.',
                          Severity: Minor
                          Found in backend/modules/gii/models/Generator.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language