Showing 344 of 344 total issues

Function color has a Cognitive Complexity of 227 (exceeds 5 allowed). Consider refactoring.
Open

    color : function(target, prop) {


        this.required = true; // refuse empty values?
        this.adjust = true; // adjust value to uniform notation?
Severity: Minor
Found in web_widget_color/static/lib/jscolor/jscolor.js - About 4 days 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 color has 573 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    color : function(target, prop) {


        this.required = true; // refuse empty values?
        this.adjust = true; // adjust value to uniform notation?
Severity: Major
Found in web_widget_color/static/lib/jscolor/jscolor.js - About 2 days to fix

    Function web_timeline has 560 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    openerp.web_timeline = function (instance) {
        'use strict';
        var Model = instance.web.Model;
        var str_to_datetime = instance.str_to_datetime;
        var _t = instance.web._t,
    Severity: Major
    Found in web_timeline/static/src/js/web_timeline.js - About 2 days to fix

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

      /* ===================================================
       * bootstrap-markdown.js v2.7.0
       * http://github.com/toopay/bootstrap-markdown
       * ===================================================
       * Copyright 2013-2014 Taufan Aditya

        File marked.js has 901 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * marked - a markdown parser
         * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
         * https://github.com/chjj/marked
         */
        Severity: Major
        Found in web_widget_text_markdown/static/lib/marked/marked.js - About 2 days to fix

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

                  {
                    name: 'cmdQuote',
                    hotkey: 'Ctrl+Q',
                    title: 'Quote',
                    icon: { glyph: 'glyphicon glyphicon-comment', fa: 'fa fa-quote-left', 'fa-3': 'icon-quote-left' },
          web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js on lines 1055..1101
          web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js on lines 1102..1148

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

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

                  data: [{
                    name: 'cmdList',
                    hotkey: 'Ctrl+U',
                    title: 'Unordered List',
                    icon: { glyph: 'glyphicon glyphicon-list', fa: 'fa fa-list', 'fa-3': 'icon-list-ul' },
          web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js on lines 1102..1148
          web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js on lines 1189..1234

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

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

                  {
                    name: 'cmdListO',
                    hotkey: 'Ctrl+O',
                    title: 'Ordered List',
                    icon: { glyph: 'glyphicon glyphicon-th-list', fa: 'fa fa-list-ol', 'fa-3': 'icon-list-ol' },
          web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js on lines 1055..1101
          web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js on lines 1189..1234

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

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

          /**
           * jscolor, JavaScript Color Picker
           *
           * @version 1.4.4
           * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
          Severity: Major
          Found in web_widget_color/static/lib/jscolor/jscolor.js - About 2 days to fix

            Function web_widget_x2many_2d_matrix has 375 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            openerp.web_widget_x2many_2d_matrix = function(instance)
            {
                instance.web.form.widgets.add(
                    'x2many_2d_matrix',
                    'instance.web_widget_x2many_2d_matrix.FieldX2Many2dMatrix');

              Function web_timeline has a Cognitive Complexity of 84 (exceeds 5 allowed). Consider refactoring.
              Open

              openerp.web_timeline = function (instance) {
                  'use strict';
                  var Model = instance.web.Model;
                  var str_to_datetime = instance.str_to_datetime;
                  var _t = instance.web._t,
              Severity: Minor
              Found in web_timeline/static/src/js/web_timeline.js - 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 web_advanced_search_x2x has 332 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              openerp.web_advanced_search_x2x = function(instance)
              {
                  instance.web_advanced_search_x2x.ExtendedSearchPropositionMany2One = 
                  instance.web.search.ExtendedSearchProposition.Char.extend(
                  instance.web.form.FieldManagerMixin,
              Severity: Major
              Found in web_advanced_search_x2x/static/src/js/web_advanced_search_x2x.js - About 1 day to fix

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

                        data: [{
                          name: 'cmdBold',
                          hotkey: 'Ctrl+B',
                          title: 'Bold',
                          icon: { glyph: 'glyphicon glyphicon-bold', fa: 'fa fa-bold', 'fa-3': 'icon-bold' },
                web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js on lines 924..954

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

                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

                        },{
                          name: 'cmdItalic',
                          title: 'Italic',
                          hotkey: 'Ctrl+I',
                          icon: { glyph: 'glyphicon glyphicon-italic', fa: 'fa fa-italic', 'fa-3': 'icon-italic' },
                web_widget_text_markdown/static/lib/bootstrap-markdown/bootstrap-markdown.js on lines 894..924

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

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

                openerp.web_m2x_options = function (instance) {
                
                    "use strict";
                
                    var QWeb = instance.web.qweb,
                Severity: Major
                Found in web_m2x_options/static/src/js/form.js - About 1 day to fix

                  File excanvas.js has 655 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  // Copyright 2006 Google Inc.
                  //
                  // Licensed under the Apache License, Version 2.0 (the "License");
                  // you may not use this file except in compliance with the License.
                  // You may obtain a copy of the License at
                  Severity: Major
                  Found in web_widget_digitized_signature/static/lib/excanvas.js - About 1 day to fix

                    Function URI has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                    Open

                        URI : function(uri) { // See RFC3986
                    
                            this.scheme = null;
                            this.authority = null;
                            this.path = '';
                    Severity: Minor
                    Found in web_widget_color/static/lib/jscolor/jscolor.js - 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 web_timeline.js has 572 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* Odoo web_timeline
                     * Copyright 2015 ACSONE SA/NV
                     * Copyright 2016 Pedro M. Baeza <pedro.baeza@tecnativa.com>
                     * License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */
                    
                    
                    Severity: Major
                    Found in web_timeline/static/src/js/web_timeline.js - About 1 day to fix

                      Function token has 213 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      Lexer.prototype.token = function(src, top, bq) {
                        var src = src.replace(/^ +$/gm, '')
                          , next
                          , loose
                          , cap
                      Severity: Major
                      Found in web_widget_text_markdown/static/lib/marked/marked.js - About 1 day to fix

                        Function web_ckeditor4 has 211 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        openerp.web_ckeditor4 = function(instance)
                        {
                            var ckeditor_addFunction_org = CKEDITOR.tools.addFunction;
                            //this is a quite complicated way to kind of monkey patch the private
                            //method onDomReady of ckeditor's plugin wysiwigarea, which causes problems
                        Severity: Major
                        Found in web_ckeditor4/static/src/js/web_ckeditor4.js - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language