YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/resources/validator/FieldValidator.js

Summary

Maintainability
F
2 wks
Test Coverage

File FieldValidator.js has 1369 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*+***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
Severity: Major
Found in public_html/layouts/resources/validator/FieldValidator.js - About 3 days to fix

    Function validate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
    Open

            validate: function () {
                let response = this._super();
                if (response != true) {
                    return response;
                }
    Severity: Minor
    Found in public_html/layouts/resources/validator/FieldValidator.js - About 2 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

    Function validateValue has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            validateValue: function (fieldValue) {
                if (fieldValue == '') {
                    return true;
                }
                var field = this.getElement();
    Severity: Major
    Found in public_html/layouts/resources/validator/FieldValidator.js - About 2 hrs to fix

      Function validate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              validate: function () {
                  let response = this._super();
                  if (response != true) {
                      return response;
                  }
      Severity: Minor
      Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

        Function validate has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

                validate: function (dependentFieldList) {
                    let field = this.getElement();
                    let fieldInfo = field.data('fieldinfo');
                    let fieldLabel = fieldInfo.label;
                    let contextFormElem = field.closest('form');
        Severity: Minor
        Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr 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 validate has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                validate: function (dependentFieldList) {
                    var field = this.getElement();
                    var fieldInfo = field.data('fieldinfo');
                    var fieldLabel;
                    if (typeof fieldInfo === 'undefined') {
        Severity: Minor
        Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

          Function validate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

                  validate: function (dependentFieldList) {
                      var field = this.getElement();
                      var fieldInfo = field.data('fieldinfo');
                      var fieldLabel;
                      if (typeof fieldInfo === 'undefined') {
          Severity: Minor
          Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr 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 validate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  validate: function (dependentFieldList) {
                      let field = this.getElement();
                      let fieldInfo = field.data('fieldinfo');
                      let fieldLabel = fieldInfo.label;
                      let contextFormElem = field.closest('form');
          Severity: Minor
          Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

            Function validate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    validate: function () {
                        var response = this._super();
                        if (response !== true) {
                            return response;
                        }
            Severity: Minor
            Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

              Function validate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                      validate: function () {
                          var response = this._super();
                          if (response !== true) {
                              return response;
                          }
              Severity: Minor
              Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr 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 validate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      validate: function (dependentFieldList) {
                          let thisInstance = this;
                          let field = this.getElement();
                          let fieldDateTime = '';
                          let fieldDateTimeInstance = [];
              Severity: Minor
              Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

                Function validate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        validate: function () {
                            let response = this._super();
                            if (response !== true) {
                                return response;
                            }
                Severity: Minor
                Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

                  Function validate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                          validate: function (dependentFieldList) {
                              let thisInstance = this;
                              let field = this.getElement();
                              let fieldDateTime = '';
                              let fieldDateTimeInstance = [];
                  Severity: Minor
                  Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr 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 validate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          validate: function () {
                              let fieldValue = this.getFieldValue(),
                                  groupSeperator = CONFIG.currencyGroupingSeparator,
                                  integerRegex = new RegExp('(^[-+]?[\\d\\' + groupSeperator + ']+)$', 'g');
                              if (!fieldValue.match(integerRegex)) {
                  Severity: Minor
                  Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

                    Function validate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            validate: function () {
                                let response = this._super();
                                if (response === true) {
                                    let fieldValue = this.getFieldValue();
                                    let doubleRegex = /(^[-+]?\d+)(\.\d+)?$/;
                    Severity: Minor
                    Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

                      Function validate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              validate: function () {
                                  var field = this.getElement();
                                  var fieldData = field.data();
                                  var fieldDateFormat = fieldData.dateFormat;
                                  var fieldInfo = fieldData.fieldinfo;
                      Severity: Minor
                      Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

                        Function validate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                validate: function () {
                                    var field = this.getElement();
                                    var fieldData = field.data();
                                    var fieldDateFormat = fieldData.dateFormat;
                                    var fieldInfo = fieldData.fieldinfo;
                        Severity: Minor
                        Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if (
                                              fieldValue.indexOf('http://') === 0 ||
                                              fieldValue.indexOf('https://') === 0 ||
                                              fieldValue.indexOf('ftp://') === 0 ||
                                              fieldValue.indexOf('ftps://') === 0 ||
                          Severity: Major
                          Found in public_html/layouts/resources/validator/FieldValidator.js - About 1 hr to fix

                            Function validate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    validate: function () {
                                        let response = this._super();
                                        if (response === true) {
                                            let fieldValue = this.getFieldValue();
                                            let doubleRegex = /(^[-+]?\d+)(\.\d+)?$/;
                            Severity: Minor
                            Found in public_html/layouts/resources/validator/FieldValidator.js - About 55 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function validate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    validate: function () {
                                        let fieldValue = this.getFieldValue(),
                                            groupSeperator = CONFIG.currencyGroupingSeparator,
                                            integerRegex = new RegExp('(^[-+]?[\\d\\' + groupSeperator + ']+)$', 'g');
                                        if (!fieldValue.match(integerRegex)) {
                            Severity: Minor
                            Found in public_html/layouts/resources/validator/FieldValidator.js - About 55 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function validate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    validate() {
                                        let fieldValue = this.getFieldValue();
                                        if (fieldValue === '') {
                                            return true;
                                        }
                            Severity: Minor
                            Found in public_html/layouts/resources/validator/FieldValidator.js - About 55 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Function validateValue has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    validateValue: function (fieldValue) {
                                        if (fieldValue == '') {
                                            return true;
                                        }
                                        var field = this.getElement();
                            Severity: Minor
                            Found in public_html/layouts/resources/validator/FieldValidator.js - About 45 mins to fix

                            Cognitive Complexity

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

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

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

                            Further reading

                            Consider simplifying this complex logical expression.
                            Open

                                            if (
                                                (ranges.length === 2 && (strippedValue > parseFloat(ranges[1]) || strippedValue < parseFloat(ranges[0]))) ||
                                                (ranges.length === 1 && (strippedValue > parseFloat(ranges[0]) || strippedValue < 0))
                                            ) {
                                                errorInfo = app.vtranslate('JS_ERROR_MAX_VALUE');
                            Severity: Major
                            Found in public_html/layouts/resources/validator/FieldValidator.js - About 40 mins to fix

                              Function validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                      validate: function () {
                                          let response = this._super();
                                          if (response !== true) {
                                              return response;
                                          }
                              Severity: Minor
                              Found in public_html/layouts/resources/validator/FieldValidator.js - 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

                              Function validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                      validate() {
                                          const fieldInstance = this.getElement();
                                          const selectElementValue = fieldInstance.val();
                                          if (Array.isArray(selectElementValue)) {
                                              for (let value of selectElementValue) {
                              Severity: Minor
                              Found in public_html/layouts/resources/validator/FieldValidator.js - 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

                              Avoid too many return statements within this function.
                              Open

                                                  return false;
                              Severity: Major
                              Found in public_html/layouts/resources/validator/FieldValidator.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return true;
                                Severity: Major
                                Found in public_html/layouts/resources/validator/FieldValidator.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return true;
                                  Severity: Major
                                  Found in public_html/layouts/resources/validator/FieldValidator.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                                return true;
                                    Severity: Major
                                    Found in public_html/layouts/resources/validator/FieldValidator.js - About 30 mins to fix

                                      Function validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                              validate: function (dependentFieldList) {
                                                  var field = this.getElement();
                                                  var fieldLabel = field.data('fieldinfo').label;
                                                  var status = field.val();
                                                  var contextFormElem = field.closest('form');
                                      Severity: Minor
                                      Found in public_html/layouts/resources/validator/FieldValidator.js - About 25 mins to fix

                                      Cognitive Complexity

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

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

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

                                      Further reading

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

                                      Vtiger_Base_Validator_Js(
                                          'Vtiger_lessThanOrEqualToToday_Validator_Js',
                                          {},
                                          {
                                              /**
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 day to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 701..739

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

                                      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

                                      Vtiger_Base_Validator_Js(
                                          'Vtiger_greaterThanOrEqualToToday_Validator_Js',
                                          {},
                                          {
                                              /**
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 day to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 661..699

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

                                      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

                                      Vtiger_Base_Validator_Js(
                                          'Calendar_greaterThanToday_Validator_Js',
                                          {},
                                          {
                                              /**
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 day to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 626..659

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

                                      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

                                      Vtiger_Base_Validator_Js(
                                          'Vtiger_lessThanToday_Validator_Js',
                                          {},
                                          {
                                              /**
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 day to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1311..1344

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

                                      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

                                      Vtiger_Base_Validator_Js(
                                          'Vtiger_AlphaNumericWithSlashesCurlyBraces_Validator_Js',
                                          {
                                              /**
                                               *Function which invokes field validation
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 7 hrs to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1433..1468

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

                                      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

                                      Vtiger_Base_Validator_Js(
                                          'Vtiger_AlphaNumeric_Validator_Js',
                                          {
                                              /**
                                               *Function which invokes field validation
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 7 hrs to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1469..1504

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

                                      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

                                              validate: function () {
                                                  var response = this._super();
                                                  if (response != true) {
                                                      return response;
                                                  } else {
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 3 hrs to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1410..1423

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

                                      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

                                              validate: function () {
                                                  var response = this._super();
                                                  if (response != true) {
                                                      return response;
                                                  } else {
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 3 hrs to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 563..576

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

                                      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

                                              getDateTimeInstance: function (field) {
                                                  var dateFormat = field.data('dateFormat');
                                                  var fieldValue = field.val();
                                                  try {
                                                      var dateTimeInstance = App.Fields.Date.getDateInstance(fieldValue, dateFormat);
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 3 hrs to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 807..817

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

                                      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

                                              getDateTimeInstance: function (field) {
                                                  var dateFormat = field.data('dateFormat');
                                                  var fieldValue = field.val();
                                                  try {
                                                      var dateTimeInstance = App.Fields.Date.getDateInstance(fieldValue, dateFormat);
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 3 hrs to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 964..974

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

                                      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

                                          {
                                              invokeValidation: function (field, rules, i, options) {
                                                  var validatorInstance = new Vtiger_Url_Validator_Js();
                                                  validatorInstance.setElement(field);
                                                  const result = validatorInstance.validate();
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 2 hrs to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 473..484

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

                                      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

                                          {
                                              invokeValidation: function (field, rules, i, options) {
                                                  var validatorInstance = new Vtiger_MultiSelect_Validator_Js();
                                                  validatorInstance.setElement(field);
                                                  var result = validatorInstance.validate();
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 2 hrs to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 426..437

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

                                      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

                                          {
                                              invokeValidation: function (field, rules, i, options) {
                                                  var instance = new Vtiger_YetiForceCompanyName_Validator_Js();
                                                  instance.setElement(field);
                                                  var response = instance.validate();
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1561..1570

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

                                      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

                                          {
                                              invokeValidation: function (field, rules, i, options) {
                                                  var instance = new Vtiger_TextParser_Validator_Js();
                                                  instance.setElement(field);
                                                  var response = instance.validate();
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1592..1601

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

                                      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 which invokes field validation
                                               * @param accepts field element as parameter
                                               * @return error if validation fails true on success
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 382..395

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

                                      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 which invokes field validation
                                               *@param accepts field element as parameter
                                               * @return error if validation fails true on success
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 254..267

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

                                      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

                                                          if ($.inArray(dependentFieldInContext.data('fieldinfo').type, ['currency', 'number', 'decimal']) !== -1) {
                                                              value = App.Fields.Double.formatToDb(field.val());
                                                              dependentValue = App.Fields.Double.formatToDb(dependentFieldInContext.val());
                                                          } else {
                                                              value = this.getDateTimeInstance(field);
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 941..947

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

                                      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

                                                          if ($.inArray(fieldInfo.type, ['currency', 'number', 'decimal']) !== -1) {
                                                              value = App.Fields.Double.formatToDb(field.val());
                                                              dependentValue = App.Fields.Double.formatToDb(dependentFieldInContext.val());
                                                          } else {
                                                              value = this.getDateTimeInstance(field);
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 783..789

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

                                      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

                                          {
                                              invokeValidation(field, rules, i, options) {
                                                  const instance = new Vtiger_MultiImage_Validator_Js();
                                                  instance.setElement(field);
                                                  if (instance.validate() != true) {
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 2 other locations - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1647..1655
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1679..1687

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

                                      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

                                          {
                                              invokeValidation(field, rules, i, options) {
                                                  const instance = new Vtiger_MaxSizeInByte_Validator_Js();
                                                  instance.setElement(field);
                                                  if (instance.validate() != true) {
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 2 other locations - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1620..1628
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1679..1687

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

                                      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

                                          {
                                              invokeValidation(field, rules, i, options) {
                                                  const instance = new Vtiger_FieldName_Validator_Js();
                                                  instance.setElement(field);
                                                  if (instance.validate() != true) {
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 2 other locations - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1620..1628
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1647..1655

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

                                      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

                                                          if (comparedDateVal < 0) {
                                                              var errorInfo =
                                                                  fieldLabel +
                                                                  ' ' +
                                                                  app.vtranslate('JS_SHOULD_BE_GREATER_THAN_OR_EQUAL_TO') +
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 954..959

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

                                      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

                                                          if (comparedDateVal > 0) {
                                                              var errorInfo =
                                                                  fieldLabel + ' ' + app.vtranslate('JS_SHOULD_BE_LESS_THAN_OR_EQUAL_TO') + ' ' + dependentFieldLabel + '';
                                                              this.setError(errorInfo);
                                                              return false;
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 1 hr to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 792..802

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

                                      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

                                              getFieldValue: function () {
                                                  return App.Fields.Double.formatToDb(this.getElement().val());
                                              }
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 3 other locations - About 30 mins to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 306..308
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 418..420
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1428..1430

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

                                      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

                                              getFieldValue: function () {
                                                  return App.Fields.Double.formatToDb(this.getElement().val());
                                              }
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 3 other locations - About 30 mins to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 306..308
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 374..376
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 418..420

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

                                      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

                                              getFieldValue: function () {
                                                  return App.Fields.Double.formatToDb(this.getElement().val());
                                              }
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 3 other locations - About 30 mins to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 374..376
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 418..420
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1428..1430

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

                                      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

                                              getFieldValue: function () {
                                                  return App.Fields.Double.formatToDb(this.getElement().val());
                                              }
                                      Severity: Major
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 3 other locations - About 30 mins to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 306..308
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 374..376
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 1428..1430

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

                                      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

                                                  if (fieldValue.length < parseInt(ranges[0])) {
                                                      this.setError(app.vtranslate('JS_ENTERED_VALUE_IS_TOO_SHORT'));
                                                      return false;
                                                  }
                                      Severity: Minor
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 30 mins to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 183..186

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

                                      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

                                                  if (fieldValue.length > parseInt(ranges[1])) {
                                                      this.setError(app.vtranslate('JS_ENTERED_VALUE_IS_TOO_LONG'));
                                                      return false;
                                                  }
                                      Severity: Minor
                                      Found in public_html/layouts/resources/validator/FieldValidator.js and 1 other location - About 30 mins to fix
                                      public_html/layouts/resources/validator/FieldValidator.js on lines 179..182

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

                                      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

                                      There are no issues that match your filters.

                                      Category
                                      Status