Noosfero/noosfero

View on GitHub

Showing 1,643 of 1,643 total issues

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

        meridiemHour : function (hour, meridiem) {
            if (hour === 12) {
                hour = 0;
            }
            if (meridiem === 'रात्री') {
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 5811..5824

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

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

    function ru__plural(word, num) {
        var forms = word.split('_');
        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
    }
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 9000..9003

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

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

    function uk__plural(word, num) {
        var forms = word.split('_');
        return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]);
    }
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 7894..7897

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

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

Function cookie has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';

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 vote_partial has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def vote_partial(target, like = true, load_voters = false)
    vote = like ? 1 : -1

    like_action = like ? "like" : "dislike"
    type = target.kind_of?(Article) ? "article" : target.kind_of?(Comment) ? "comment" : nil
Severity: Minor
Found in plugins/vote/lib/vote_plugin_helper.rb - About 4 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 report_orders_by_consumer has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    def report_orders_by_consumer(orders)
      p = Axlsx::Package.new
      wb = p.workbook

      # create styles
Severity: Minor
Found in plugins/orders/lib/orders_plugin/report.rb - About 4 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 invite has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def self.invite(person, contacts_to_invite, message, profile)
    contacts_to_invite.each do |contact_to_invite|
      next if contact_to_invite == _("Firstname Lastname <friend@email.com>")

      contact_to_invite = contact_to_invite.to_s.strip
Severity: Minor
Found in app/models/invitation.rb - About 4 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 extra_blocks has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

  def extra_blocks(params = {})
    return [] if self.class.extra_blocks.nil?

    blocks = self.class.extra_blocks.map do |block, options|
      type = options[:type]
Severity: Minor
Found in lib/noosfero/plugin.rb - About 4 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

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

    var ne__symbolMap = {
        '1': '१',
        '2': '२',
        '3': '३',
        '4': '४',
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 7 other locations - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 3196..3218
plugins/orders/public/javascripts/moment-with-locales.js on lines 3767..3790
plugins/orders/public/javascripts/moment-with-locales.js on lines 3869..3892
plugins/orders/public/javascripts/moment-with-locales.js on lines 5204..5226
plugins/orders/public/javascripts/moment-with-locales.js on lines 5736..5759
plugins/orders/public/javascripts/moment-with-locales.js on lines 7106..7129
plugins/orders/public/javascripts/moment-with-locales.js on lines 7287..7309

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

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

    var bo__symbolMap = {
        '1': '༡',
        '2': '༢',
        '3': '༣',
        '4': '༤',
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 7 other locations - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 3196..3218
plugins/orders/public/javascripts/moment-with-locales.js on lines 3767..3790
plugins/orders/public/javascripts/moment-with-locales.js on lines 5204..5226
plugins/orders/public/javascripts/moment-with-locales.js on lines 5736..5759
plugins/orders/public/javascripts/moment-with-locales.js on lines 7106..7129
plugins/orders/public/javascripts/moment-with-locales.js on lines 7287..7309
plugins/orders/public/javascripts/moment-with-locales.js on lines 7418..7441

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

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

    var my__symbolMap = {
        '1': '၁',
        '2': '၂',
        '3': '၃',
        '4': '၄',
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 7 other locations - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 3196..3218
plugins/orders/public/javascripts/moment-with-locales.js on lines 3767..3790
plugins/orders/public/javascripts/moment-with-locales.js on lines 3869..3892
plugins/orders/public/javascripts/moment-with-locales.js on lines 5204..5226
plugins/orders/public/javascripts/moment-with-locales.js on lines 5736..5759
plugins/orders/public/javascripts/moment-with-locales.js on lines 7106..7129
plugins/orders/public/javascripts/moment-with-locales.js on lines 7418..7441

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

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

    var bn__symbolMap = {
        '1': '১',
        '2': '২',
        '3': '৩',
        '4': '৪',
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 7 other locations - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 3196..3218
plugins/orders/public/javascripts/moment-with-locales.js on lines 3869..3892
plugins/orders/public/javascripts/moment-with-locales.js on lines 5204..5226
plugins/orders/public/javascripts/moment-with-locales.js on lines 5736..5759
plugins/orders/public/javascripts/moment-with-locales.js on lines 7106..7129
plugins/orders/public/javascripts/moment-with-locales.js on lines 7287..7309
plugins/orders/public/javascripts/moment-with-locales.js on lines 7418..7441

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

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

    var fa__symbolMap = {
        '1': '۱',
        '2': '۲',
        '3': '۳',
        '4': '۴',
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 7 other locations - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 3196..3218
plugins/orders/public/javascripts/moment-with-locales.js on lines 3767..3790
plugins/orders/public/javascripts/moment-with-locales.js on lines 3869..3892
plugins/orders/public/javascripts/moment-with-locales.js on lines 5736..5759
plugins/orders/public/javascripts/moment-with-locales.js on lines 7106..7129
plugins/orders/public/javascripts/moment-with-locales.js on lines 7287..7309
plugins/orders/public/javascripts/moment-with-locales.js on lines 7418..7441

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

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

    var mr__symbolMap = {
        '1': '१',
        '2': '२',
        '3': '३',
        '4': '४',
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 7 other locations - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 3196..3218
plugins/orders/public/javascripts/moment-with-locales.js on lines 3767..3790
plugins/orders/public/javascripts/moment-with-locales.js on lines 3869..3892
plugins/orders/public/javascripts/moment-with-locales.js on lines 5204..5226
plugins/orders/public/javascripts/moment-with-locales.js on lines 5736..5759
plugins/orders/public/javascripts/moment-with-locales.js on lines 7287..7309
plugins/orders/public/javascripts/moment-with-locales.js on lines 7418..7441

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

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

    var ar_sa__symbolMap = {
        '1': '١',
        '2': '٢',
        '3': '٣',
        '4': '٤',
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 7 other locations - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 3767..3790
plugins/orders/public/javascripts/moment-with-locales.js on lines 3869..3892
plugins/orders/public/javascripts/moment-with-locales.js on lines 5204..5226
plugins/orders/public/javascripts/moment-with-locales.js on lines 5736..5759
plugins/orders/public/javascripts/moment-with-locales.js on lines 7106..7129
plugins/orders/public/javascripts/moment-with-locales.js on lines 7287..7309
plugins/orders/public/javascripts/moment-with-locales.js on lines 7418..7441

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

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

    var hi__symbolMap = {
        '1': '१',
        '2': '२',
        '3': '३',
        '4': '४',
Severity: Major
Found in plugins/orders/public/javascripts/moment-with-locales.js and 7 other locations - About 4 hrs to fix
plugins/orders/public/javascripts/moment-with-locales.js on lines 3196..3218
plugins/orders/public/javascripts/moment-with-locales.js on lines 3767..3790
plugins/orders/public/javascripts/moment-with-locales.js on lines 3869..3892
plugins/orders/public/javascripts/moment-with-locales.js on lines 5204..5226
plugins/orders/public/javascripts/moment-with-locales.js on lines 7106..7129
plugins/orders/public/javascripts/moment-with-locales.js on lines 7287..7309
plugins/orders/public/javascripts/moment-with-locales.js on lines 7418..7441

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

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 date_field has 103 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def date_field(name, value, datepicker_options = {}, html_options = {})
    datepicker_options[:disabled] ||= false
    datepicker_options[:alt_field] ||= ""
    datepicker_options[:alt_format] ||= ""
    datepicker_options[:append_text] ||= ""
Severity: Major
Found in app/helpers/forms_helper.rb - About 4 hrs to fix

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

      $('form').submit(function () {
        $.ajax({
          url: this.action,
          data: $(this).serialize(),
          beforeSend: function(){$('#queries').addClass('fetching')},
    Severity: Major
    Found in plugins/custom_forms/public/queries.js and 1 other location - About 4 hrs to fix
    public/javascripts/manage-organizations.js on lines 39..48

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

    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

      $('#manage-profiles').submit(function () {
        $.ajax({
          url: this.action,
          data: $(this).serialize(),
          beforeSend: function(){$('#manage-profiles .results').addClass('fetching')},
    Severity: Major
    Found in public/javascripts/manage-organizations.js and 1 other location - About 4 hrs to fix
    plugins/custom_forms/public/queries.js on lines 15..24

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

    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 shopping_cart_plugin_controller.rb has 334 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "base64"
    
    class ShoppingCartPluginController < OrdersPluginController
      include ShoppingCartPlugin::CartHelper
      helper ShoppingCartPlugin::CartHelper
    Severity: Minor
    Found in plugins/shopping_cart/controllers/shopping_cart_plugin_controller.rb - About 4 hrs to fix
      Severity
      Category
      Status
      Source
      Language