Noosfero/noosfero

View on GitHub

Showing 1,643 of 1,643 total issues

Class Person has 85 methods (exceeds 20 allowed). Consider refactoring.
Open

class Person < Profile
  attr_accessible :organization, :contact_information, :sex, :birth_date, :cell_phone,
                  :comercial_phone, :jabber_id, :personal_website, :nationality, :schooling,
                  :schooling_status, :formation, :custom_formation, :area_of_study,
                  :custom_area_of_study, :professional_activity, :organization_website,
Severity: Major
Found in app/models/person.rb - About 1 day to fix

    File bootstrap-tokenfield.js has 701 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * bootstrap-tokenfield
     * https://github.com/sliptree/bootstrap-tokenfield
     * Copyright 2013-2014 Sliptree and other contributors; Licensed MIT
     */
    Severity: Major
    Found in plugins/fb_app/public/javascripts/bootstrap-tokenfield.js - About 1 day to fix

      Function socialSharePrivacy has 303 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function socialSharePrivacy (options) {
      
              if (typeof options === "string") {
                  var command = options;
                  if (arguments.length === 1) {

        Method products has a Cognitive Complexity of 75 (exceeds 5 allowed). Consider refactoring.
        Open

          def self.products(consumer, csv)
            default_product_category = consumer.environment.product_categories.find_by slug: "software-livre"
        
            detection = CharlockHolmes::EncodingDetector.detect csv
            csv = CharlockHolmes::Converter.convert csv, detection[:encoding], "UTF-8"
        Severity: Minor
        Found in plugins/suppliers/lib/suppliers_plugin/import.rb - About 1 day to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function matchRecursive has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
        Open

        XRegExp.matchRecursive = function (str, left, right, flags, options) {
            var options      = options || {},
                escapeChar   = options.escapeChar,
                vN           = options.valueNames,
                flags        = flags || "",

        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

            var fo = _moment__default.defineLocale('fo', {
                months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
                monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
                weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'),
                weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'),
        Severity: Major
        Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 1 day to fix
        plugins/orders/public/javascripts/moment-with-locales.js on lines 7590..7633

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

        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

            var nn = _moment__default.defineLocale('nn', {
                months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'),
                monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'),
                weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'),
                weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'),
        Severity: Major
        Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 1 day to fix
        plugins/orders/public/javascripts/moment-with-locales.js on lines 5394..5437

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

        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 socialshareprivacy.js has 639 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * @license
         * jquery.socialshareprivacy.js | 2 Klicks fuer mehr Datenschutz
         *
         * http://www.heise.de/extras/socialshareprivacy/

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

              var de_at = _moment__default.defineLocale('de-at', {
                  months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
                  monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
                  weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
                  weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
          Severity: Major
          Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 1 day to fix
          plugins/orders/public/javascripts/moment-with-locales.js on lines 4657..4700

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

          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

              var de = _moment__default.defineLocale('de', {
                  months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
                  monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'),
                  weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
                  weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
          Severity: Major
          Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 1 day to fix
          plugins/orders/public/javascripts/moment-with-locales.js on lines 4593..4636

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

          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

              var uz = _moment__default.defineLocale('uz', {
                  months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'),
                  monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'),
                  weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'),
                  weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'),
          Severity: Major
          Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 1 day to fix
          plugins/orders/public/javascripts/moment-with-locales.js on lines 8905..8946

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

          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

              var tzm_latn = _moment__default.defineLocale('tzm-latn', {
                  months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
                  monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'),
                  weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
                  weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'),
          Severity: Major
          Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 1 day to fix
          plugins/orders/public/javascripts/moment-with-locales.js on lines 9141..9182

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

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

                  setOptions: function(options, callback) {
          
                      this.startDate = moment().startOf('day');
                      this.endDate = moment().endOf('day');
                      this.timeZone = moment().utcOffset();
          Severity: Major
          Found in plugins/orders/public/javascripts/daterangepicker.js - About 1 day to fix

            Method head_ending has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
            Open

              def head_ending
                plugin = self
                lambda do
                  variable = plugin.class.controllers.send controller.controller_path rescue nil
                  variable ||= plugin.class.controllers.send :profile if controller.is_a? ProfileController
            Severity: Minor
            Found in plugins/metadata/lib/metadata_plugin/base.rb - About 1 day 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

            File cms_controller.rb has 568 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            class CmsController < MyProfileController
              protect "edit_profile", :profile, only: [:set_home_page]
            
              include ArticleHelper
              include CategoriesHelper
            Severity: Major
            Found in app/controllers/my_profile/cms_controller.rb - About 1 day to fix

              Function ajax has 240 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ajax: function( url, options ) {
              
                      // If url is an object, simulate pre-1.5 signature
                      if ( typeof url === "object" ) {
                          options = url;

                File class.tree.php has 560 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                class _tree_struct {
                    // Structure table and fields
                    protected $table    = "";
                    protected $fields    = array(

                  File person.rb has 557 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class Person < Profile
                    attr_accessible :organization, :contact_information, :sex, :birth_date, :cell_phone,
                                    :comercial_phone, :jabber_id, :personal_website, :nationality, :schooling,
                                    :schooling_status, :formation, :custom_formation, :area_of_study,
                                    :custom_area_of_study, :professional_activity, :organization_website,
                  Severity: Major
                  Found in app/models/person.rb - About 1 day to fix

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

                        var sr_cyrl__translator = {
                            words: { //Different grammatical cases
                                m: ['један минут', 'једне минуте'],
                                mm: ['минут', 'минуте', 'минута'],
                                h: ['један сат', 'једног сата'],
                    Severity: Major
                    Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 1 day to fix
                    plugins/orders/public/javascripts/moment-with-locales.js on lines 8484..8505

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

                    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

                        var sr__translator = {
                            words: { //Different grammatical cases
                                m: ['jedan minut', 'jedne minute'],
                                mm: ['minut', 'minute', 'minuta'],
                                h: ['jedan sat', 'jednog sata'],
                    Severity: Major
                    Found in plugins/orders/public/javascripts/moment-with-locales.js and 1 other location - About 1 day to fix
                    plugins/orders/public/javascripts/moment-with-locales.js on lines 8387..8408

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

                    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