talho/openphin

View on GitHub

Showing 3,486 of 3,486 total issues

Method add_notification_responses has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def add_notification_responses(xml)
    unless message.IVRTree.blank?
      provider = message.Behavior.Delivery.Providers.select{|c| c.name == "swn" && c.device == "E-mail"}.first

      message.IVRTree.select{|ivr| ivr.name == provider.ivr}.each do |ivr|
Severity: Minor
Found in app/models/service/swn/email/message.rb - About 35 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 xml_build_messages has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def xml_build_messages builder, options={}
    options={} if options.blank?
    builder.Messages do |messages|
      if options[:override]
          options[:override].call(messages)
Severity: Minor
Found in app/models/alert.rb - About 35 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 xml_build_ivrtree has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def xml_build_ivrtree builder, options={}
    options={} if options.blank?
    builder.IVRTree do |ivrtree|
      if options[:override]
          options[:override].call(ivrtree)
Severity: Minor
Found in app/models/alert.rb - About 35 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 deliver has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def self.deliver item
    message = self.parse(case item.class
    when String
      comparer = "<?xml"
      if item[0..(comparer.length - 1)] == comparer
Severity: Minor
Found in app/models/message_api.rb - About 35 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 show_clean has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def show_clean
    @total = 0
    unless params[:tag].blank?
      without = params[:without_ids].nil? || params[:without_ids].empty? || params[:without_ids][0].blank? ? {} : {:user_id => params[:without_ids]}
      search_size = (params[:limit]||20).to_i
Severity: Minor
Found in app/controllers/searches_controller.rb - About 35 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 hud has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def hud
    DashboardController.app_toolbar "han"
    @user = current_user
    require 'will_paginate/array'
    per_page = ( params[:per_page].to_i > 0 ? params[:per_page].to_i : 10 )
Severity: Minor
Found in app/controllers/dashboard_controller.rb - About 35 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 menu has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def menu
    @report_menu = "{name: 'Reports', tab:{id: 'reports', title:'Reports', initializer: 'Talho.Reports'}}" if current_user.has_non_public_role?

    plugin_config_items = []    
    $menu_config.each do |app, val|
Severity: Minor
Found in app/controllers/dashboard_controller.rb - About 35 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 destroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def destroy
    @device = Device.find(params[:id])
    if current_user == @device.user || current_user.is_admin_for?(@device.user.jurisdictions)
      @device.destroy
      begin
Severity: Minor
Found in app/controllers/devices_controller.rb - About 35 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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    @role_request = RoleRequest.new(params[:role_request])
    @role_request.requester = current_user
    @role_request.user = current_user

Severity: Minor
Found in app/controllers/role_requests_controller.rb - About 35 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 15 locations. Consider refactoring.
Open

Talho.NewInvitation.initialize = function(config){
  var o = new Talho.NewInvitation(config);
  return o.getPanel();
};
Severity: Major
Found in app/assets/javascripts/invitations/NewInvitation.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
app/assets/javascripts/dashboard/tutorials.js on lines 35..39
app/assets/javascripts/documents/Documents.js on lines 491..494
app/assets/javascripts/invitations/Invitations.js on lines 413..416
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditPassword.js on lines 24..27
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
app/assets/javascripts/profile/ManageRoles.js on lines 48..51
app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

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

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

Talho.AdvancedSearch.initialize = function(config)
{
    var as = new Talho.AdvancedSearch(config);
    return as.getPanel();
};
Severity: Major
Found in app/assets/javascripts/searches/AdvancedSearch.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
app/assets/javascripts/dashboard/tutorials.js on lines 35..39
app/assets/javascripts/documents/Documents.js on lines 491..494
app/assets/javascripts/invitations/Invitations.js on lines 413..416
app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditPassword.js on lines 24..27
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
app/assets/javascripts/profile/ManageRoles.js on lines 48..51

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

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

Talho.ManageRoles.initialize = function(config){
  var o = new Talho.ManageRoles(config);
  return o.getPanel();
};
Severity: Major
Found in app/assets/javascripts/profile/ManageRoles.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
app/assets/javascripts/dashboard/tutorials.js on lines 35..39
app/assets/javascripts/documents/Documents.js on lines 491..494
app/assets/javascripts/invitations/Invitations.js on lines 413..416
app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditPassword.js on lines 24..27
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

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

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

Talho.Documents.initializer = function(config){
    var documents = new Talho.Documents(config);
    return documents.getPanel();
};
Severity: Major
Found in app/assets/javascripts/documents/Documents.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
app/assets/javascripts/dashboard/tutorials.js on lines 35..39
app/assets/javascripts/invitations/Invitations.js on lines 413..416
app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditPassword.js on lines 24..27
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
app/assets/javascripts/profile/ManageRoles.js on lines 48..51
app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

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

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

Talho.Invitations.initialize = function(config) {
  var o = new Talho.Invitations(config);
  return o.getPanel();
};
Severity: Major
Found in app/assets/javascripts/invitations/Invitations.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
app/assets/javascripts/dashboard/tutorials.js on lines 35..39
app/assets/javascripts/documents/Documents.js on lines 491..494
app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditPassword.js on lines 24..27
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
app/assets/javascripts/profile/ManageRoles.js on lines 48..51
app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

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

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

Talho.ManageOrganizations.initialize = function(config){
  var o = new Talho.ManageOrganizations(config);
  return o.getPanel();
};
Severity: Major
Found in app/assets/javascripts/profile/ManageOrganizations.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
app/assets/javascripts/dashboard/tutorials.js on lines 35..39
app/assets/javascripts/documents/Documents.js on lines 491..494
app/assets/javascripts/invitations/Invitations.js on lines 413..416
app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditPassword.js on lines 24..27
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageRoles.js on lines 48..51
app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

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

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

Talho.Tutorials.initialize = function(config)
{
  var tutorials = new Talho.Tutorials(config);
  return tutorials.getPanel();
};
Severity: Major
Found in app/assets/javascripts/dashboard/tutorials.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
app/assets/javascripts/documents/Documents.js on lines 491..494
app/assets/javascripts/invitations/Invitations.js on lines 413..416
app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditPassword.js on lines 24..27
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
app/assets/javascripts/profile/ManageRoles.js on lines 48..51
app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

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

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

  constructor: function(){
    Talho.Admin.Apps.view.Roles.superclass.constructor.apply(this, arguments);
  },
Severity: Major
Found in app/assets/javascripts/admin/apps/view/Roles.js and 3 other locations - About 35 mins to fix
app/assets/javascripts/admin/apps/view/About.js on lines 9..11
app/assets/javascripts/admin/apps/view/Assets.js on lines 8..10
app/assets/javascripts/admin/apps/view/Details.js on lines 8..10

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

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

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

              this.store.loadData(Ext.decode(action.response.responseText), !Ext.getCmp('chk-overwrite').checked);
Severity: Minor
Found in app/assets/javascripts/admin/BatchUsers.js and 1 other location - About 35 mins to fix
app/assets/javascripts/invitations/NewInvitation.js on lines 62..62

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

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

Talho.EditPassword.initialize = function(config){
  var o = new Talho.EditPassword(config);
  return o.getPanel();
};
Severity: Major
Found in app/assets/javascripts/profile/EditPassword.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/admin/PendingRoleRequests.js on lines 40..43
app/assets/javascripts/dashboard/tutorials.js on lines 35..39
app/assets/javascripts/documents/Documents.js on lines 491..494
app/assets/javascripts/invitations/Invitations.js on lines 413..416
app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
app/assets/javascripts/profile/ManageRoles.js on lines 48..51
app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

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

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

Talho.PendingRoleRequests.initialize = function(config){
  var alerts = new Talho.PendingRoleRequests(config);
  return alerts.getPanel();
};
Severity: Major
Found in app/assets/javascripts/admin/PendingRoleRequests.js and 14 other locations - About 35 mins to fix
app/assets/javascripts/admin/AddUser.js on lines 83..86
app/assets/javascripts/admin/AuditLog.js on lines 236..239
app/assets/javascripts/admin/BatchUsers.js on lines 213..216
app/assets/javascripts/admin/EditUsers.js on lines 182..185
app/assets/javascripts/dashboard/tutorials.js on lines 35..39
app/assets/javascripts/documents/Documents.js on lines 491..494
app/assets/javascripts/invitations/Invitations.js on lines 413..416
app/assets/javascripts/invitations/NewInvitation.js on lines 305..308
app/assets/javascripts/profile/EditDevices.js on lines 47..50
app/assets/javascripts/profile/EditPassword.js on lines 24..27
app/assets/javascripts/profile/EditProfile.js on lines 139..142
app/assets/javascripts/profile/ManageOrganizations.js on lines 48..51
app/assets/javascripts/profile/ManageRoles.js on lines 48..51
app/assets/javascripts/searches/AdvancedSearch.js on lines 98..102

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

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