sibprogrammer/owp

View on GitHub

Showing 803 of 803 total issues

Method save_limits has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def save_limits(limits)
    orig_limits = get_limits
    vzctl_params = ''
    limits.each do |limit|
      orig_limit = orig_limits.find { |item| item[:name] == limit['name'] }
Severity: Minor
Found in app/models/virtual_server.rb - About 55 mins 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 connect has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def connect(root_password = '')
    if !auth_key.blank?
      begin
        if !rpc_client.ping
          self.errors.add :auth_key, :bad_auth
Severity: Minor
Found in app/models/hardware_server.rb - About 55 mins 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 load_config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def load_config
    file = File.new(CONFIG_FILE, 'r')

    while (line = file.gets)
      key, value = line.split('=', 2).each { |v| v.strip! }
Severity: Minor
Found in utils/hw-daemon/hw-daemon.rb - About 55 mins 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 prepare_daemon_config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def prepare_daemon_config(sftp, config_file)
      if !sftp_file_readable(sftp, config_file)
        upload_daemon_config(sftp, config_file)
      else
        sftp.file.open(config_file, "r") do |file|
Severity: Minor
Found in app/models/hardware_server.rb - About 55 mins 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 objects_group_operation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def objects_group_operation(model, operation, &access)
      success = true

      params[:ids].split(',').each do |id|
        object = model.find(id)
Severity: Minor
Found in app/controllers/admin/base.rb - About 55 mins 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 collect_cpu_usage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def collect_cpu_usage(hardware_server)
    ve_list = hardware_server.virtual_servers.find_all_by_state('running').map(&:identity).join(' ')
    command = "for VE in #{ve_list}; do echo $VE `vzctl exec $VE 'cat /proc/stat | head -1'`; done"
    counters = hardware_server.rpc_client.exec(command)['output'].split("\n")

Severity: Minor
Found in utils/watchdog/watchdog.rb - About 55 mins 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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def update
    role = (params[:id].to_i > 0) ? Role.find_by_id(params[:id]) : Role.new
    is_new = role.new_record?
    role.attributes = params

Severity: Minor
Found in app/controllers/admin/roles_controller.rb - About 55 mins 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 get_ram_mb has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def get_ram_mb(limit)
    return 0 if limit.blank?
    limit = limit.include?(':') ? limit.split(":").last : limit
    return 0 if ('unlimited' == limit)

Severity: Minor
Found in app/helpers/application_helper.rb - About 55 mins 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

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

            :value => {
              'text' => t(
                'admin.hardware_servers.stats.value.disk_usage',
                :percent => partition['usage_percent'].to_s,
                :free =>  helper.number_to_human_size(partition['free_bytes'], :locale => :en),
Severity: Minor
Found in app/controllers/admin/hardware_servers_controller.rb and 1 other location - About 55 mins to fix
app/controllers/admin/hardware_servers_controller.rb on lines 129..137

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 44.

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 2 locations. Consider refactoring.
Open

          :value => {
            'text' => t(
              'admin.hardware_servers.stats.value.memory_usage',
              :percent => memory_usage['usage_percent'].to_s,
              :free =>  helper.number_to_human_size(memory_usage['free_bytes'], :locale => :en),
Severity: Minor
Found in app/controllers/admin/hardware_servers_controller.rb and 1 other location - About 55 mins to fix
app/controllers/admin/hardware_servers_controller.rb on lines 110..118

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 44.

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

Method reinstall has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def reinstall
    virtual_server = VirtualServer.find_by_id(params[:id])
    if !virtual_server or !@current_user.can_control(virtual_server) or !@current_user.can_reinstall_ve?
      redirect_to :controller => 'dashboard' and return
    end
Severity: Minor
Found in app/controllers/admin/virtual_servers_controller.rb - About 45 mins 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 initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def initialize
    check_environment

    if (0 == ARGV.size)
      do_help
Severity: Minor
Found in utils/hw-daemon/hw-daemon.rb - About 45 mins 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 get_limits has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def get_limits
    parser = IniParser.new(hardware_server.rpc_client.exec('cat', "/etc/vz/conf/#{identity.to_s}.conf")['output'])

    limits = [
      'KMEMSIZE', 'LOCKEDPAGES', 'SHMPAGES', 'NUMPROC',
Severity: Minor
Found in app/models/virtual_server.rb - About 45 mins 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 install_daemon has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def install_daemon(root_password)
    if root_password.blank?
      self.errors.add :root_password, :empty
      return false
    end
Severity: Minor
Found in app/models/hardware_server.rb - About 45 mins 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 collect_beancounters has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def collect_beancounters(hardware_server)
    counters = hardware_server.rpc_client.exec('cat', "/proc/user_beancounters")['output'].split("\n")

    # remove table titles
    counters.shift; counters.shift
Severity: Minor
Found in utils/watchdog/watchdog.rb - About 45 mins 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

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

if(Ext.form.ComboBox){
   Ext.apply(Ext.form.ComboBox.prototype, {
      loadingText       : "Öüñôùóç...",
      valueNotFoundText : undefined
   });
Severity: Major
Found in public/ext/locale/ext-lang-gr.js and 44 other locations - About 45 mins to fix
public/ext/locale/ext-lang-af.js on lines 145..150
public/ext/locale/ext-lang-bg.js on lines 161..166
public/ext/locale/ext-lang-ca.js on lines 170..175
public/ext/locale/ext-lang-cs.js on lines 168..173
public/ext/locale/ext-lang-da.js on lines 171..176
public/ext/locale/ext-lang-de.js on lines 180..185
public/ext/locale/ext-lang-el_GR.js on lines 182..187
public/ext/locale/ext-lang-en.js on lines 178..183
public/ext/locale/ext-lang-en_GB.js on lines 174..179
public/ext/locale/ext-lang-es.js on lines 173..178
public/ext/locale/ext-lang-fa.js on lines 155..160
public/ext/locale/ext-lang-fi.js on lines 173..178
public/ext/locale/ext-lang-fr.js on lines 195..200
public/ext/locale/ext-lang-fr_CA.js on lines 179..184
public/ext/locale/ext-lang-he.js on lines 167..172
public/ext/locale/ext-lang-hr.js on lines 170..175
public/ext/locale/ext-lang-hu.js on lines 171..176
public/ext/locale/ext-lang-id.js on lines 177..182
public/ext/locale/ext-lang-it.js on lines 169..174
public/ext/locale/ext-lang-ja.js on lines 173..178
public/ext/locale/ext-lang-ko.js on lines 140..145
public/ext/locale/ext-lang-lt.js on lines 182..187
public/ext/locale/ext-lang-lv.js on lines 137..142
public/ext/locale/ext-lang-mk.js on lines 137..142
public/ext/locale/ext-lang-nl.js on lines 178..183
public/ext/locale/ext-lang-no_NB.js on lines 169..174
public/ext/locale/ext-lang-no_NN.js on lines 169..174
public/ext/locale/ext-lang-pl.js on lines 179..184
public/ext/locale/ext-lang-pt.js on lines 143..148
public/ext/locale/ext-lang-pt_BR.js on lines 185..190
public/ext/locale/ext-lang-pt_PT.js on lines 168..173
public/ext/locale/ext-lang-ro.js on lines 169..174
public/ext/locale/ext-lang-ru.js on lines 183..188
public/ext/locale/ext-lang-sk.js on lines 143..148
public/ext/locale/ext-lang-sl.js on lines 137..142
public/ext/locale/ext-lang-sr.js on lines 140..145
public/ext/locale/ext-lang-sr_RS.js on lines 139..144
public/ext/locale/ext-lang-sv_SE.js on lines 139..144
public/ext/locale/ext-lang-th.js on lines 169..174
public/ext/locale/ext-lang-tr.js on lines 183..188
public/ext/locale/ext-lang-ukr.js on lines 144..149
public/ext/locale/ext-lang-vn.js on lines 142..147
public/ext/locale/ext-lang-zh_CN.js on lines 145..150
public/ext/locale/ext-lang-zh_TW.js on lines 139..144

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 50.

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 45 locations. Consider refactoring.
Open

if(Ext.form.ComboBox){
  Ext.apply(Ext.form.ComboBox.prototype, {
    loadingText: 'Bezig met laden...',
    valueNotFoundText: undefined
  });
Severity: Major
Found in public/ext/locale/ext-lang-nl.js and 44 other locations - About 45 mins to fix
public/ext/locale/ext-lang-af.js on lines 145..150
public/ext/locale/ext-lang-bg.js on lines 161..166
public/ext/locale/ext-lang-ca.js on lines 170..175
public/ext/locale/ext-lang-cs.js on lines 168..173
public/ext/locale/ext-lang-da.js on lines 171..176
public/ext/locale/ext-lang-de.js on lines 180..185
public/ext/locale/ext-lang-el_GR.js on lines 182..187
public/ext/locale/ext-lang-en.js on lines 178..183
public/ext/locale/ext-lang-en_GB.js on lines 174..179
public/ext/locale/ext-lang-es.js on lines 173..178
public/ext/locale/ext-lang-fa.js on lines 155..160
public/ext/locale/ext-lang-fi.js on lines 173..178
public/ext/locale/ext-lang-fr.js on lines 195..200
public/ext/locale/ext-lang-fr_CA.js on lines 179..184
public/ext/locale/ext-lang-gr.js on lines 136..141
public/ext/locale/ext-lang-he.js on lines 167..172
public/ext/locale/ext-lang-hr.js on lines 170..175
public/ext/locale/ext-lang-hu.js on lines 171..176
public/ext/locale/ext-lang-id.js on lines 177..182
public/ext/locale/ext-lang-it.js on lines 169..174
public/ext/locale/ext-lang-ja.js on lines 173..178
public/ext/locale/ext-lang-ko.js on lines 140..145
public/ext/locale/ext-lang-lt.js on lines 182..187
public/ext/locale/ext-lang-lv.js on lines 137..142
public/ext/locale/ext-lang-mk.js on lines 137..142
public/ext/locale/ext-lang-no_NB.js on lines 169..174
public/ext/locale/ext-lang-no_NN.js on lines 169..174
public/ext/locale/ext-lang-pl.js on lines 179..184
public/ext/locale/ext-lang-pt.js on lines 143..148
public/ext/locale/ext-lang-pt_BR.js on lines 185..190
public/ext/locale/ext-lang-pt_PT.js on lines 168..173
public/ext/locale/ext-lang-ro.js on lines 169..174
public/ext/locale/ext-lang-ru.js on lines 183..188
public/ext/locale/ext-lang-sk.js on lines 143..148
public/ext/locale/ext-lang-sl.js on lines 137..142
public/ext/locale/ext-lang-sr.js on lines 140..145
public/ext/locale/ext-lang-sr_RS.js on lines 139..144
public/ext/locale/ext-lang-sv_SE.js on lines 139..144
public/ext/locale/ext-lang-th.js on lines 169..174
public/ext/locale/ext-lang-tr.js on lines 183..188
public/ext/locale/ext-lang-ukr.js on lines 144..149
public/ext/locale/ext-lang-vn.js on lines 142..147
public/ext/locale/ext-lang-zh_CN.js on lines 145..150
public/ext/locale/ext-lang-zh_TW.js on lines 139..144

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 50.

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 45 locations. Consider refactoring.
Open

if(Ext.form.ComboBox){
  Ext.apply(Ext.form.ComboBox.prototype, {
    loadingText       : "Lastar...",
    valueNotFoundText : undefined
  });
Severity: Major
Found in public/ext/locale/ext-lang-no_NN.js and 44 other locations - About 45 mins to fix
public/ext/locale/ext-lang-af.js on lines 145..150
public/ext/locale/ext-lang-bg.js on lines 161..166
public/ext/locale/ext-lang-ca.js on lines 170..175
public/ext/locale/ext-lang-cs.js on lines 168..173
public/ext/locale/ext-lang-da.js on lines 171..176
public/ext/locale/ext-lang-de.js on lines 180..185
public/ext/locale/ext-lang-el_GR.js on lines 182..187
public/ext/locale/ext-lang-en.js on lines 178..183
public/ext/locale/ext-lang-en_GB.js on lines 174..179
public/ext/locale/ext-lang-es.js on lines 173..178
public/ext/locale/ext-lang-fa.js on lines 155..160
public/ext/locale/ext-lang-fi.js on lines 173..178
public/ext/locale/ext-lang-fr.js on lines 195..200
public/ext/locale/ext-lang-fr_CA.js on lines 179..184
public/ext/locale/ext-lang-gr.js on lines 136..141
public/ext/locale/ext-lang-he.js on lines 167..172
public/ext/locale/ext-lang-hr.js on lines 170..175
public/ext/locale/ext-lang-hu.js on lines 171..176
public/ext/locale/ext-lang-id.js on lines 177..182
public/ext/locale/ext-lang-it.js on lines 169..174
public/ext/locale/ext-lang-ja.js on lines 173..178
public/ext/locale/ext-lang-ko.js on lines 140..145
public/ext/locale/ext-lang-lt.js on lines 182..187
public/ext/locale/ext-lang-lv.js on lines 137..142
public/ext/locale/ext-lang-mk.js on lines 137..142
public/ext/locale/ext-lang-nl.js on lines 178..183
public/ext/locale/ext-lang-no_NB.js on lines 169..174
public/ext/locale/ext-lang-pl.js on lines 179..184
public/ext/locale/ext-lang-pt.js on lines 143..148
public/ext/locale/ext-lang-pt_BR.js on lines 185..190
public/ext/locale/ext-lang-pt_PT.js on lines 168..173
public/ext/locale/ext-lang-ro.js on lines 169..174
public/ext/locale/ext-lang-ru.js on lines 183..188
public/ext/locale/ext-lang-sk.js on lines 143..148
public/ext/locale/ext-lang-sl.js on lines 137..142
public/ext/locale/ext-lang-sr.js on lines 140..145
public/ext/locale/ext-lang-sr_RS.js on lines 139..144
public/ext/locale/ext-lang-sv_SE.js on lines 139..144
public/ext/locale/ext-lang-th.js on lines 169..174
public/ext/locale/ext-lang-tr.js on lines 183..188
public/ext/locale/ext-lang-ukr.js on lines 144..149
public/ext/locale/ext-lang-vn.js on lines 142..147
public/ext/locale/ext-lang-zh_CN.js on lines 145..150
public/ext/locale/ext-lang-zh_TW.js on lines 139..144

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 50.

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 45 locations. Consider refactoring.
Open

if(Ext.form.ComboBox){
   Ext.apply(Ext.form.ComboBox.prototype, {
      loadingText       : "Henter...",
      valueNotFoundText : undefined
   });
Severity: Major
Found in public/ext/locale/ext-lang-da.js and 44 other locations - About 45 mins to fix
public/ext/locale/ext-lang-af.js on lines 145..150
public/ext/locale/ext-lang-bg.js on lines 161..166
public/ext/locale/ext-lang-ca.js on lines 170..175
public/ext/locale/ext-lang-cs.js on lines 168..173
public/ext/locale/ext-lang-de.js on lines 180..185
public/ext/locale/ext-lang-el_GR.js on lines 182..187
public/ext/locale/ext-lang-en.js on lines 178..183
public/ext/locale/ext-lang-en_GB.js on lines 174..179
public/ext/locale/ext-lang-es.js on lines 173..178
public/ext/locale/ext-lang-fa.js on lines 155..160
public/ext/locale/ext-lang-fi.js on lines 173..178
public/ext/locale/ext-lang-fr.js on lines 195..200
public/ext/locale/ext-lang-fr_CA.js on lines 179..184
public/ext/locale/ext-lang-gr.js on lines 136..141
public/ext/locale/ext-lang-he.js on lines 167..172
public/ext/locale/ext-lang-hr.js on lines 170..175
public/ext/locale/ext-lang-hu.js on lines 171..176
public/ext/locale/ext-lang-id.js on lines 177..182
public/ext/locale/ext-lang-it.js on lines 169..174
public/ext/locale/ext-lang-ja.js on lines 173..178
public/ext/locale/ext-lang-ko.js on lines 140..145
public/ext/locale/ext-lang-lt.js on lines 182..187
public/ext/locale/ext-lang-lv.js on lines 137..142
public/ext/locale/ext-lang-mk.js on lines 137..142
public/ext/locale/ext-lang-nl.js on lines 178..183
public/ext/locale/ext-lang-no_NB.js on lines 169..174
public/ext/locale/ext-lang-no_NN.js on lines 169..174
public/ext/locale/ext-lang-pl.js on lines 179..184
public/ext/locale/ext-lang-pt.js on lines 143..148
public/ext/locale/ext-lang-pt_BR.js on lines 185..190
public/ext/locale/ext-lang-pt_PT.js on lines 168..173
public/ext/locale/ext-lang-ro.js on lines 169..174
public/ext/locale/ext-lang-ru.js on lines 183..188
public/ext/locale/ext-lang-sk.js on lines 143..148
public/ext/locale/ext-lang-sl.js on lines 137..142
public/ext/locale/ext-lang-sr.js on lines 140..145
public/ext/locale/ext-lang-sr_RS.js on lines 139..144
public/ext/locale/ext-lang-sv_SE.js on lines 139..144
public/ext/locale/ext-lang-th.js on lines 169..174
public/ext/locale/ext-lang-tr.js on lines 183..188
public/ext/locale/ext-lang-ukr.js on lines 144..149
public/ext/locale/ext-lang-vn.js on lines 142..147
public/ext/locale/ext-lang-zh_CN.js on lines 145..150
public/ext/locale/ext-lang-zh_TW.js on lines 139..144

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 50.

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 45 locations. Consider refactoring.
Open

if(Ext.form.ComboBox){
  Ext.apply(Ext.form.ComboBox.prototype, {
    loadingText       : "Laster...",
    valueNotFoundText : undefined
  });
Severity: Major
Found in public/ext/locale/ext-lang-no_NB.js and 44 other locations - About 45 mins to fix
public/ext/locale/ext-lang-af.js on lines 145..150
public/ext/locale/ext-lang-bg.js on lines 161..166
public/ext/locale/ext-lang-ca.js on lines 170..175
public/ext/locale/ext-lang-cs.js on lines 168..173
public/ext/locale/ext-lang-da.js on lines 171..176
public/ext/locale/ext-lang-de.js on lines 180..185
public/ext/locale/ext-lang-el_GR.js on lines 182..187
public/ext/locale/ext-lang-en.js on lines 178..183
public/ext/locale/ext-lang-en_GB.js on lines 174..179
public/ext/locale/ext-lang-es.js on lines 173..178
public/ext/locale/ext-lang-fa.js on lines 155..160
public/ext/locale/ext-lang-fi.js on lines 173..178
public/ext/locale/ext-lang-fr.js on lines 195..200
public/ext/locale/ext-lang-fr_CA.js on lines 179..184
public/ext/locale/ext-lang-gr.js on lines 136..141
public/ext/locale/ext-lang-he.js on lines 167..172
public/ext/locale/ext-lang-hr.js on lines 170..175
public/ext/locale/ext-lang-hu.js on lines 171..176
public/ext/locale/ext-lang-id.js on lines 177..182
public/ext/locale/ext-lang-it.js on lines 169..174
public/ext/locale/ext-lang-ja.js on lines 173..178
public/ext/locale/ext-lang-ko.js on lines 140..145
public/ext/locale/ext-lang-lt.js on lines 182..187
public/ext/locale/ext-lang-lv.js on lines 137..142
public/ext/locale/ext-lang-mk.js on lines 137..142
public/ext/locale/ext-lang-nl.js on lines 178..183
public/ext/locale/ext-lang-no_NN.js on lines 169..174
public/ext/locale/ext-lang-pl.js on lines 179..184
public/ext/locale/ext-lang-pt.js on lines 143..148
public/ext/locale/ext-lang-pt_BR.js on lines 185..190
public/ext/locale/ext-lang-pt_PT.js on lines 168..173
public/ext/locale/ext-lang-ro.js on lines 169..174
public/ext/locale/ext-lang-ru.js on lines 183..188
public/ext/locale/ext-lang-sk.js on lines 143..148
public/ext/locale/ext-lang-sl.js on lines 137..142
public/ext/locale/ext-lang-sr.js on lines 140..145
public/ext/locale/ext-lang-sr_RS.js on lines 139..144
public/ext/locale/ext-lang-sv_SE.js on lines 139..144
public/ext/locale/ext-lang-th.js on lines 169..174
public/ext/locale/ext-lang-tr.js on lines 183..188
public/ext/locale/ext-lang-ukr.js on lines 144..149
public/ext/locale/ext-lang-vn.js on lines 142..147
public/ext/locale/ext-lang-zh_CN.js on lines 145..150
public/ext/locale/ext-lang-zh_TW.js on lines 139..144

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 50.

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

Severity
Category
Status
Source
Language