sibprogrammer/owp

View on GitHub

Showing 803 of 803 total issues

Similar blocks of code found in 42 locations. Consider refactoring.
Open

if(Ext.util.Format){
   Ext.util.Format.date = function(v, format){
      if(!v) return "";
      if(!(v instanceof Date)) v = new Date(Date.parse(v));
      return v.dateFormat(format || "y年m月d日");
Severity: Major
Found in public/ext/locale/ext-lang-zh_CN.js and 41 other locations - About 2 hrs to fix
public/ext/locale/ext-lang-af.js on lines 75..81
public/ext/locale/ext-lang-bg.js on lines 89..95
public/ext/locale/ext-lang-ca.js on lines 92..98
public/ext/locale/ext-lang-cs.js on lines 96..102
public/ext/locale/ext-lang-da.js on lines 99..105
public/ext/locale/ext-lang-el_GR.js on lines 114..120
public/ext/locale/ext-lang-en.js on lines 96..102
public/ext/locale/ext-lang-en_GB.js on lines 92..98
public/ext/locale/ext-lang-es.js on lines 95..101
public/ext/locale/ext-lang-fa.js on lines 84..90
public/ext/locale/ext-lang-fi.js on lines 97..103
public/ext/locale/ext-lang-fr_CA.js on lines 111..117
public/ext/locale/ext-lang-gr.js on lines 68..74
public/ext/locale/ext-lang-he.js on lines 95..101
public/ext/locale/ext-lang-hr.js on lines 99..105
public/ext/locale/ext-lang-hu.js on lines 99..105
public/ext/locale/ext-lang-id.js on lines 104..110
public/ext/locale/ext-lang-it.js on lines 97..103
public/ext/locale/ext-lang-ja.js on lines 95..101
public/ext/locale/ext-lang-ko.js on lines 69..75
public/ext/locale/ext-lang-lt.js on lines 110..116
public/ext/locale/ext-lang-lv.js on lines 68..74
public/ext/locale/ext-lang-mk.js on lines 69..75
public/ext/locale/ext-lang-nl.js on lines 100..106
public/ext/locale/ext-lang-no_NB.js on lines 97..103
public/ext/locale/ext-lang-no_NN.js on lines 97..103
public/ext/locale/ext-lang-pl.js on lines 106..112
public/ext/locale/ext-lang-pt.js on lines 72..78
public/ext/locale/ext-lang-pt_PT.js on lines 92..98
public/ext/locale/ext-lang-ro.js on lines 97..103
public/ext/locale/ext-lang-ru.js on lines 111..117
public/ext/locale/ext-lang-sk.js on lines 72..78
public/ext/locale/ext-lang-sl.js on lines 68..74
public/ext/locale/ext-lang-sr.js on lines 70..76
public/ext/locale/ext-lang-sr_RS.js on lines 70..76
public/ext/locale/ext-lang-sv_SE.js on lines 70..76
public/ext/locale/ext-lang-th.js on lines 97..103
public/ext/locale/ext-lang-tr.js on lines 111..117
public/ext/locale/ext-lang-ukr.js on lines 73..79
public/ext/locale/ext-lang-vn.js on lines 74..80
public/ext/locale/ext-lang-zh_TW.js on lines 69..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 42 locations. Consider refactoring.
Open

if(Ext.util.Format){
   Ext.util.Format.date = function(v, format){
      if(!v) return "";
      if(!(v instanceof Date)) v = new Date(Date.parse(v));
      return v.dateFormat(format || "d/m/Y");
Severity: Major
Found in public/ext/locale/ext-lang-da.js and 41 other locations - About 2 hrs to fix
public/ext/locale/ext-lang-af.js on lines 75..81
public/ext/locale/ext-lang-bg.js on lines 89..95
public/ext/locale/ext-lang-ca.js on lines 92..98
public/ext/locale/ext-lang-cs.js on lines 96..102
public/ext/locale/ext-lang-el_GR.js on lines 114..120
public/ext/locale/ext-lang-en.js on lines 96..102
public/ext/locale/ext-lang-en_GB.js on lines 92..98
public/ext/locale/ext-lang-es.js on lines 95..101
public/ext/locale/ext-lang-fa.js on lines 84..90
public/ext/locale/ext-lang-fi.js on lines 97..103
public/ext/locale/ext-lang-fr_CA.js on lines 111..117
public/ext/locale/ext-lang-gr.js on lines 68..74
public/ext/locale/ext-lang-he.js on lines 95..101
public/ext/locale/ext-lang-hr.js on lines 99..105
public/ext/locale/ext-lang-hu.js on lines 99..105
public/ext/locale/ext-lang-id.js on lines 104..110
public/ext/locale/ext-lang-it.js on lines 97..103
public/ext/locale/ext-lang-ja.js on lines 95..101
public/ext/locale/ext-lang-ko.js on lines 69..75
public/ext/locale/ext-lang-lt.js on lines 110..116
public/ext/locale/ext-lang-lv.js on lines 68..74
public/ext/locale/ext-lang-mk.js on lines 69..75
public/ext/locale/ext-lang-nl.js on lines 100..106
public/ext/locale/ext-lang-no_NB.js on lines 97..103
public/ext/locale/ext-lang-no_NN.js on lines 97..103
public/ext/locale/ext-lang-pl.js on lines 106..112
public/ext/locale/ext-lang-pt.js on lines 72..78
public/ext/locale/ext-lang-pt_PT.js on lines 92..98
public/ext/locale/ext-lang-ro.js on lines 97..103
public/ext/locale/ext-lang-ru.js on lines 111..117
public/ext/locale/ext-lang-sk.js on lines 72..78
public/ext/locale/ext-lang-sl.js on lines 68..74
public/ext/locale/ext-lang-sr.js on lines 70..76
public/ext/locale/ext-lang-sr_RS.js on lines 70..76
public/ext/locale/ext-lang-sv_SE.js on lines 70..76
public/ext/locale/ext-lang-th.js on lines 97..103
public/ext/locale/ext-lang-tr.js on lines 111..117
public/ext/locale/ext-lang-ukr.js on lines 73..79
public/ext/locale/ext-lang-vn.js on lines 74..80
public/ext/locale/ext-lang-zh_CN.js on lines 75..81
public/ext/locale/ext-lang-zh_TW.js on lines 69..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 42 locations. Consider refactoring.
Open

if(Ext.util.Format){
   Ext.util.Format.date = function(v, format){
      if(!v) return "";
      if(!(v instanceof Date)) v = new Date(Date.parse(v));
      return v.dateFormat(format || "Y-m-d");
Severity: Major
Found in public/ext/locale/ext-lang-sv_SE.js and 41 other locations - About 2 hrs to fix
public/ext/locale/ext-lang-af.js on lines 75..81
public/ext/locale/ext-lang-bg.js on lines 89..95
public/ext/locale/ext-lang-ca.js on lines 92..98
public/ext/locale/ext-lang-cs.js on lines 96..102
public/ext/locale/ext-lang-da.js on lines 99..105
public/ext/locale/ext-lang-el_GR.js on lines 114..120
public/ext/locale/ext-lang-en.js on lines 96..102
public/ext/locale/ext-lang-en_GB.js on lines 92..98
public/ext/locale/ext-lang-es.js on lines 95..101
public/ext/locale/ext-lang-fa.js on lines 84..90
public/ext/locale/ext-lang-fi.js on lines 97..103
public/ext/locale/ext-lang-fr_CA.js on lines 111..117
public/ext/locale/ext-lang-gr.js on lines 68..74
public/ext/locale/ext-lang-he.js on lines 95..101
public/ext/locale/ext-lang-hr.js on lines 99..105
public/ext/locale/ext-lang-hu.js on lines 99..105
public/ext/locale/ext-lang-id.js on lines 104..110
public/ext/locale/ext-lang-it.js on lines 97..103
public/ext/locale/ext-lang-ja.js on lines 95..101
public/ext/locale/ext-lang-ko.js on lines 69..75
public/ext/locale/ext-lang-lt.js on lines 110..116
public/ext/locale/ext-lang-lv.js on lines 68..74
public/ext/locale/ext-lang-mk.js on lines 69..75
public/ext/locale/ext-lang-nl.js on lines 100..106
public/ext/locale/ext-lang-no_NB.js on lines 97..103
public/ext/locale/ext-lang-no_NN.js on lines 97..103
public/ext/locale/ext-lang-pl.js on lines 106..112
public/ext/locale/ext-lang-pt.js on lines 72..78
public/ext/locale/ext-lang-pt_PT.js on lines 92..98
public/ext/locale/ext-lang-ro.js on lines 97..103
public/ext/locale/ext-lang-ru.js on lines 111..117
public/ext/locale/ext-lang-sk.js on lines 72..78
public/ext/locale/ext-lang-sl.js on lines 68..74
public/ext/locale/ext-lang-sr.js on lines 70..76
public/ext/locale/ext-lang-sr_RS.js on lines 70..76
public/ext/locale/ext-lang-th.js on lines 97..103
public/ext/locale/ext-lang-tr.js on lines 111..117
public/ext/locale/ext-lang-ukr.js on lines 73..79
public/ext/locale/ext-lang-vn.js on lines 74..80
public/ext/locale/ext-lang-zh_CN.js on lines 75..81
public/ext/locale/ext-lang-zh_TW.js on lines 69..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 42 locations. Consider refactoring.
Open

if(Ext.util.Format){
  Ext.util.Format.date = function(v, format){
    if(!v) return "";
    if(!(v instanceof Date)) v = new Date(Date.parse(v));
    return v.dateFormat(format || "Y/m/d");
Severity: Major
Found in public/ext/locale/ext-lang-pt_PT.js and 41 other locations - About 2 hrs to fix
public/ext/locale/ext-lang-af.js on lines 75..81
public/ext/locale/ext-lang-bg.js on lines 89..95
public/ext/locale/ext-lang-ca.js on lines 92..98
public/ext/locale/ext-lang-cs.js on lines 96..102
public/ext/locale/ext-lang-da.js on lines 99..105
public/ext/locale/ext-lang-el_GR.js on lines 114..120
public/ext/locale/ext-lang-en.js on lines 96..102
public/ext/locale/ext-lang-en_GB.js on lines 92..98
public/ext/locale/ext-lang-es.js on lines 95..101
public/ext/locale/ext-lang-fa.js on lines 84..90
public/ext/locale/ext-lang-fi.js on lines 97..103
public/ext/locale/ext-lang-fr_CA.js on lines 111..117
public/ext/locale/ext-lang-gr.js on lines 68..74
public/ext/locale/ext-lang-he.js on lines 95..101
public/ext/locale/ext-lang-hr.js on lines 99..105
public/ext/locale/ext-lang-hu.js on lines 99..105
public/ext/locale/ext-lang-id.js on lines 104..110
public/ext/locale/ext-lang-it.js on lines 97..103
public/ext/locale/ext-lang-ja.js on lines 95..101
public/ext/locale/ext-lang-ko.js on lines 69..75
public/ext/locale/ext-lang-lt.js on lines 110..116
public/ext/locale/ext-lang-lv.js on lines 68..74
public/ext/locale/ext-lang-mk.js on lines 69..75
public/ext/locale/ext-lang-nl.js on lines 100..106
public/ext/locale/ext-lang-no_NB.js on lines 97..103
public/ext/locale/ext-lang-no_NN.js on lines 97..103
public/ext/locale/ext-lang-pl.js on lines 106..112
public/ext/locale/ext-lang-pt.js on lines 72..78
public/ext/locale/ext-lang-ro.js on lines 97..103
public/ext/locale/ext-lang-ru.js on lines 111..117
public/ext/locale/ext-lang-sk.js on lines 72..78
public/ext/locale/ext-lang-sl.js on lines 68..74
public/ext/locale/ext-lang-sr.js on lines 70..76
public/ext/locale/ext-lang-sr_RS.js on lines 70..76
public/ext/locale/ext-lang-sv_SE.js on lines 70..76
public/ext/locale/ext-lang-th.js on lines 97..103
public/ext/locale/ext-lang-tr.js on lines 111..117
public/ext/locale/ext-lang-ukr.js on lines 73..79
public/ext/locale/ext-lang-vn.js on lines 74..80
public/ext/locale/ext-lang-zh_CN.js on lines 75..81
public/ext/locale/ext-lang-zh_TW.js on lines 69..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 42 locations. Consider refactoring.
Open

if(Ext.util.Format){
  Ext.util.Format.date = function(v, format){
    if(!v) return "";
    if(!(v instanceof Date)) v = new Date(Date.parse(v));
    return v.dateFormat(format || "d/m/Y");
Severity: Major
Found in public/ext/locale/ext-lang-ca.js and 41 other locations - About 2 hrs to fix
public/ext/locale/ext-lang-af.js on lines 75..81
public/ext/locale/ext-lang-bg.js on lines 89..95
public/ext/locale/ext-lang-cs.js on lines 96..102
public/ext/locale/ext-lang-da.js on lines 99..105
public/ext/locale/ext-lang-el_GR.js on lines 114..120
public/ext/locale/ext-lang-en.js on lines 96..102
public/ext/locale/ext-lang-en_GB.js on lines 92..98
public/ext/locale/ext-lang-es.js on lines 95..101
public/ext/locale/ext-lang-fa.js on lines 84..90
public/ext/locale/ext-lang-fi.js on lines 97..103
public/ext/locale/ext-lang-fr_CA.js on lines 111..117
public/ext/locale/ext-lang-gr.js on lines 68..74
public/ext/locale/ext-lang-he.js on lines 95..101
public/ext/locale/ext-lang-hr.js on lines 99..105
public/ext/locale/ext-lang-hu.js on lines 99..105
public/ext/locale/ext-lang-id.js on lines 104..110
public/ext/locale/ext-lang-it.js on lines 97..103
public/ext/locale/ext-lang-ja.js on lines 95..101
public/ext/locale/ext-lang-ko.js on lines 69..75
public/ext/locale/ext-lang-lt.js on lines 110..116
public/ext/locale/ext-lang-lv.js on lines 68..74
public/ext/locale/ext-lang-mk.js on lines 69..75
public/ext/locale/ext-lang-nl.js on lines 100..106
public/ext/locale/ext-lang-no_NB.js on lines 97..103
public/ext/locale/ext-lang-no_NN.js on lines 97..103
public/ext/locale/ext-lang-pl.js on lines 106..112
public/ext/locale/ext-lang-pt.js on lines 72..78
public/ext/locale/ext-lang-pt_PT.js on lines 92..98
public/ext/locale/ext-lang-ro.js on lines 97..103
public/ext/locale/ext-lang-ru.js on lines 111..117
public/ext/locale/ext-lang-sk.js on lines 72..78
public/ext/locale/ext-lang-sl.js on lines 68..74
public/ext/locale/ext-lang-sr.js on lines 70..76
public/ext/locale/ext-lang-sr_RS.js on lines 70..76
public/ext/locale/ext-lang-sv_SE.js on lines 70..76
public/ext/locale/ext-lang-th.js on lines 97..103
public/ext/locale/ext-lang-tr.js on lines 111..117
public/ext/locale/ext-lang-ukr.js on lines 73..79
public/ext/locale/ext-lang-vn.js on lines 74..80
public/ext/locale/ext-lang-zh_CN.js on lines 75..81
public/ext/locale/ext-lang-zh_TW.js on lines 69..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 42 locations. Consider refactoring.
Open

if(Ext.util.Format){
  Ext.util.Format.date = function(v, format){
    if(!v) return "";
    if(!(v instanceof Date)) v = new Date(Date.parse(v));
    return v.dateFormat(format || "Y m d");
Severity: Major
Found in public/ext/locale/ext-lang-hu.js and 41 other locations - About 2 hrs to fix
public/ext/locale/ext-lang-af.js on lines 75..81
public/ext/locale/ext-lang-bg.js on lines 89..95
public/ext/locale/ext-lang-ca.js on lines 92..98
public/ext/locale/ext-lang-cs.js on lines 96..102
public/ext/locale/ext-lang-da.js on lines 99..105
public/ext/locale/ext-lang-el_GR.js on lines 114..120
public/ext/locale/ext-lang-en.js on lines 96..102
public/ext/locale/ext-lang-en_GB.js on lines 92..98
public/ext/locale/ext-lang-es.js on lines 95..101
public/ext/locale/ext-lang-fa.js on lines 84..90
public/ext/locale/ext-lang-fi.js on lines 97..103
public/ext/locale/ext-lang-fr_CA.js on lines 111..117
public/ext/locale/ext-lang-gr.js on lines 68..74
public/ext/locale/ext-lang-he.js on lines 95..101
public/ext/locale/ext-lang-hr.js on lines 99..105
public/ext/locale/ext-lang-id.js on lines 104..110
public/ext/locale/ext-lang-it.js on lines 97..103
public/ext/locale/ext-lang-ja.js on lines 95..101
public/ext/locale/ext-lang-ko.js on lines 69..75
public/ext/locale/ext-lang-lt.js on lines 110..116
public/ext/locale/ext-lang-lv.js on lines 68..74
public/ext/locale/ext-lang-mk.js on lines 69..75
public/ext/locale/ext-lang-nl.js on lines 100..106
public/ext/locale/ext-lang-no_NB.js on lines 97..103
public/ext/locale/ext-lang-no_NN.js on lines 97..103
public/ext/locale/ext-lang-pl.js on lines 106..112
public/ext/locale/ext-lang-pt.js on lines 72..78
public/ext/locale/ext-lang-pt_PT.js on lines 92..98
public/ext/locale/ext-lang-ro.js on lines 97..103
public/ext/locale/ext-lang-ru.js on lines 111..117
public/ext/locale/ext-lang-sk.js on lines 72..78
public/ext/locale/ext-lang-sl.js on lines 68..74
public/ext/locale/ext-lang-sr.js on lines 70..76
public/ext/locale/ext-lang-sr_RS.js on lines 70..76
public/ext/locale/ext-lang-sv_SE.js on lines 70..76
public/ext/locale/ext-lang-th.js on lines 97..103
public/ext/locale/ext-lang-tr.js on lines 111..117
public/ext/locale/ext-lang-ukr.js on lines 73..79
public/ext/locale/ext-lang-vn.js on lines 74..80
public/ext/locale/ext-lang-zh_CN.js on lines 75..81
public/ext/locale/ext-lang-zh_TW.js on lines 69..75

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 94.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

File ext-lang-de.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * Ext JS Library 3.2.1
 * Copyright(c) 2006-2010 Ext JS, Inc.
 * licensing@extjs.com
 * http://www.extjs.com/license
Severity: Minor
Found in public/ext/locale/ext-lang-de.js - About 2 hrs to fix

    File ext-lang-lt.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * Ext JS Library 3.2.1
     * Copyright(c) 2006-2010 Ext JS, Inc.
     * licensing@extjs.com
     * http://www.extjs.com/license
    Severity: Minor
    Found in public/ext/locale/ext-lang-lt.js - About 2 hrs to fix

      File application.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      Ext.BLANK_IMAGE_URL = BASE_URL + '/images/blank.gif';
      Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
      Ext.QuickTips.init();
      Ext.form.Field.prototype.msgTarget = 'side';
      Ext.Ajax.timeout = 30 * 60 * 1000;
      Severity: Minor
      Found in public/javascripts/application.js - About 2 hrs to fix

        Class VirtualServersController has 25 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Admin::VirtualServersController < Admin::Base
          before_filter :superadmin_required, :only => [:list_data, :delete, :create, :clone, :migrate]
          before_filter :set_server_by_id, :only => [ :clone, :migrate, :create_template, :get_properties, :get_stats, :get_limits ]
        
          def list
        Severity: Minor
        Found in app/controllers/admin/virtual_servers_controller.rb - About 2 hrs to fix

          Class HardwareServer has 25 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class HardwareServer < ActiveRecord::Base
            include ApplicationHelper
          
            attr_accessible :host, :auth_key, :description, :daemon_port, :use_ssl
            validates_uniqueness_of :host
          Severity: Minor
          Found in app/models/hardware_server.rb - About 2 hrs to fix

            File ext-lang-ru.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*!
             * Ext JS Library 3.2.1
             * Copyright(c) 2006-2010 Ext JS, Inc.
             * licensing@extjs.com
             * http://www.extjs.com/license
            Severity: Minor
            Found in public/ext/locale/ext-lang-ru.js - About 2 hrs to fix

              File ext-lang-nl.js has 280 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*!
               * Ext JS Library 3.2.1
               * Copyright(c) 2006-2010 Ext JS, Inc.
               * licensing@extjs.com
               * http://www.extjs.com/license
              Severity: Minor
              Found in public/ext/locale/ext-lang-nl.js - About 2 hrs to fix

                File ext-lang-en_GB.js has 278 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /*!
                 * Ext JS Library 3.2.1
                 * Copyright(c) 2006-2010 Ext JS, Inc.
                 * licensing@extjs.com
                 * http://www.extjs.com/license
                Severity: Minor
                Found in public/ext/locale/ext-lang-en_GB.js - About 2 hrs to fix

                  File ext-lang-es.js has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*!
                   * Ext JS Library 3.2.1
                   * Copyright(c) 2006-2010 Ext JS, Inc.
                   * licensing@extjs.com
                   * http://www.extjs.com/license
                  Severity: Minor
                  Found in public/ext/locale/ext-lang-es.js - About 2 hrs to fix

                    File ext-lang-ja.js has 274 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*!
                     * Ext JS Library 3.2.1
                     * Copyright(c) 2006-2010 Ext JS, Inc.
                     * licensing@extjs.com
                     * http://www.extjs.com/license
                    Severity: Minor
                    Found in public/ext/locale/ext-lang-ja.js - About 2 hrs to fix

                      File ext-lang-ca.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /*!
                       * Ext JS Library 3.2.1
                       * Copyright(c) 2006-2010 Ext JS, Inc.
                       * licensing@extjs.com
                       * http://www.extjs.com/license
                      Severity: Minor
                      Found in public/ext/locale/ext-lang-ca.js - About 2 hrs to fix

                        File hardware_server.rb has 270 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        class HardwareServer < ActiveRecord::Base
                          include ApplicationHelper
                        
                          attr_accessible :host, :auth_key, :description, :daemon_port, :use_ssl
                          validates_uniqueness_of :host
                        Severity: Minor
                        Found in app/models/hardware_server.rb - About 2 hrs to fix

                          Method create_backup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def self.create_backup(virtual_server, ve_state, description)
                              orig_ve_state = virtual_server.state
                              if 'running' == orig_ve_state
                                case ve_state
                                  when 'suspend' then virtual_server.suspend
                          Severity: Minor
                          Found in app/models/backup.rb - About 2 hrs 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 stat_details has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def stat_details
                              @virtual_server = VirtualServer.find_by_id(params[:id])
                              redirect_to :controller => 'dashboard' and return if !@virtual_server or !@current_user.can_control(@virtual_server)
                          
                              @up_level = '/admin/virtual-servers/show?id=' + @virtual_server.id.to_s
                          Severity: Minor
                          Found in app/controllers/admin/virtual_servers_controller.rb - About 2 hrs 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

                          Severity
                          Category
                          Status
                          Source
                          Language