Showing 208 of 445 total issues

File Common.js has 1041 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* global GLOBAL, $, jQuery, google, getDiv, init, addAttr, cancelForm, translationLoaded */
/* exported openTab, openPopup, closePopup, loadPage, animateLoaderBar, 
updateAllValues, processTable, getTableValidatableCell, getTableReadOnlyCell,
getTableEditableContent, getSubTableTitle, getTableCheckmark, getTableLoaderBar,
getTableImage, toggleItem, getElementValidity, selectName, setValue, overDisplay,
Severity: Major
Found in Common.js - About 2 days to fix

    File Associate.js has 839 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* global GLOBAL, google, $, displayError, getTableTitle, displayElement, 
    toStringDate, getTableCheckmark, getTableImage, getTableLoaderBar, indexOf, 
    toValue, translate, setHtml, getLink, openTab, getPopupContent, openPopup,
    addPopupButtonEvent, closePopup, animateLoaderBar, updateAllValues, updateValues,
    toCurrency, getTableReadOnlyContent, toFirstUpperCase, getTranslateData, getDiv,
    Severity: Major
    Found in Associate.js - About 2 days to fix

      Function processMail has a Cognitive Complexity of 77 (exceeds 5 allowed). Consider refactoring.
      Open

      function processMail() {
        const x = new Date();
        const h = x.getHours();
        if (h >= FH && h <= LH) {
          const sheet = _getSheet(ALERT);
      Severity: Minor
      Found in GoogleAppsScript - TradFi/TradFi.js - About 1 day to fix

      Cognitive Complexity

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

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

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

      Further reading

      File TradFi.js has 645 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* global GLOBAL, $, google, restrainFormula, updateAllValues, getMenuButton, 
      displayElement, getValue, overDisplay, toStringDate, displayError, setValue, 
      executionSuccess, updateValues, indexOf, showLoader, toValue, toCurrency, 
      getTableTitle, getSubTableTitle, getTableReadOnlyCell, getTableValidatableCell,
      processTable, getTableReadOnlyContent, openTab, shouldRebalance, getColor,
      Severity: Major
      Found in TradFi.js - About 1 day to fix

        Function numberToText has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring.
        Open

        function numberToText(number) {
          const ones = [
            "",
            "un ",
            "deux ",
        Severity: Minor
        Found in Associate.js - About 1 day to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function updateInvestmentTable has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
        Open

        function updateInvestmentTable(id, contents) {
          displayElement("rebalanceButton", shouldRebalance(contents[contents.length - 1][GLOBAL.rebalCol]));
        
          clearTransactionName();
        
        Severity: Minor
        Found in TradFi.js - About 1 day to fix

        Cognitive Complexity

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

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

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

        Further reading

        Function withdraw has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
        Open

        function withdraw() {
          if (WITHDRAW_NOW || _isMarketOpen(0, 6, 7, 21)) {
            // Value init
            const msheet = _getSheet(MERCHANT);
            const array = msheet.getSheetValues(FR, FC, -1, -1);
        Severity: Minor
        Found in GoogleAppsScript - Pay/Pay.js - About 7 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 getTableEditableContent has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
        Open

        function getTableEditableContent(content, data) {
          var label = "",
            post = "",
            classText = "",
            handler = "";
        Severity: Minor
        Found in Common.js - About 6 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

        File TradFi.js has 437 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* global CacheService, GmailApp, FR, FC, FH, LH, FD, LD, LOADING,
        _isMarketOpen, _getSheet, _copyFormula, _isLoading, _isError, _indexOf, _toDate
        _archiveMessage, _sendMessage, _setRangeValues, _toStringDate, _round, _toFixed
        _insertFirstRow, _copyFirstRow, _isCurrentMonth, _deleteOlderThanAYear,
        _AreRowsDifferent, _toCurrency, _toPercent, _isSubHour */
        Severity: Minor
        Found in GoogleAppsScript - TradFi/TradFi.js - About 6 hrs to fix

          Function updateTransactionsTable has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
          Open

          function updateTransactionsTable(id, contents) {
            const hasContent = contents && contents.length > 1;
            if (hasContent) {
              const row = contents.length;
              const col = contents[0].length;
          Severity: Minor
          Found in Associate.js - About 6 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 compareResultData has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

          function compareResultData(id, contents) {
            if (contents.length > 1) {
              // Preparing data
              var dupCnt = 0;
              var errCnt = 0;
          Severity: Minor
          Found in TradFi.js - About 6 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 checkElement has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
          Open

          function checkElement(e) {
            const type = e.dataset.type;
          
            // Filter the entered value through a regular expression
            if (isNumberInput(type)) {
          Severity: Minor
          Found in Common.js - About 5 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 _processStockTrade has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
          Open

          function _processStockTrade(thread) {
            // Get ids from investment table
            const sheet = _getSheet(INVESTMENT);
            const array = sheet.getSheetValues(FR, FC, -1, Math.max(TYPE_COL, ISIN_COL, LABEL_COL));
          
          Severity: Minor
          Found in GoogleAppsScript - TradFi/TradFi.js - About 5 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 validateAddForm has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          function validateAddForm() {
            var tDate = toStringDate(null, true); // Current date, reversed
          
            var tType = $("#transactionName").children(":selected").attr("title");
          
          Severity: Minor
          Found in TradFi.js - About 5 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 onKeyUp has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
          Open

          function onKeyUp(e) {
            if (
              !$("#addTransactionForm").is(":animated") &&
              !$("#deleteTransactionForm").is(":animated") &&
              !$("#uploadFileForm").is(":animated") &&
          Severity: Minor
          Found in TradFi.js - About 4 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function _processAccountTransaction has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          function _processAccountTransaction(thread) {
            const sheet = _getSheet(EXPHISTO);
            const array = sheet.getSheetValues(FR, FC, -1, 3);
          
            const messages = thread.getMessages();
          Severity: Minor
          Found in GoogleAppsScript - TradFi/TradFi.js - About 3 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 parseData_ has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          function parseData_(headers, data, path, state, value, query, options, includeFunc) {
            var dataInserted = false;
          
            if (Array.isArray(value) && isObjectArray_(value)) {
              for (var i = 0; i < value.length; i++) {
          Severity: Minor
          Found in GoogleAppsScript - Pay/ImportJSON.js - About 3 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 parseData_ has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          function parseData_(headers, data, path, state, value, query, options, includeFunc) {
            var dataInserted = false;
          
            if (Array.isArray(value) && isObjectArray_(value)) {
              for (var i = 0; i < value.length; i++) {
          Severity: Minor
          Found in GoogleAppsScript - DeFi/ImportJSON.js - About 3 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 updateHistoricTable has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          function updateHistoricTable(id, contents) {
            $(".validateButton").prop("disabled", true);
          
            displayElement("uploadButton", true);
            displayElement("addButton", true);
          Severity: Minor
          Found in TradFi.js - About 3 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 parseData_ has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          function parseData_(headers, data, path, state, value, query, options, includeFunc) {
            var dataInserted = false;
          
            if (Array.isArray(value) && isObjectArray_(value)) {
              for (var i = 0; i < value.length; i++) {
          Severity: Minor
          Found in GoogleAppsScript - Associate/ImportJSON.js - About 3 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

          Severity
          Category
          Status
          Source
          Language