makeomatic/ms-payments

View on GitHub

Showing 93 of 93 total issues

Function syncTransactions has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

async function syncTransactions(dispatch, agreementId, owner, start, end) {
Severity: Minor
Found in src/utils/paypal/transactions.js - About 35 mins to fix

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

    async function agreementState({ params: message }) {
      const { config, redis, amqp, log } = this;
      const { agreement: agreementId, state: action } = message;
      const note = message.note || `Applying '${action}' operation to agreement`;
    
    
    Severity: Minor
    Found in src/actions/agreement/state.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 performSync has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    async function performSync(ctx, { log }) {
      const { agreements, txIds } = await getUpdatedTransactions(ctx);
    
      // done - nothing to sync
      if (agreements.size === 0) {
    Severity: Minor
    Found in src/actions/transaction/sync-updated.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 transactionSync has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    function transactionSync({ params: message = {} }) {
      const { config, redis } = this;
      const { paypal: paypalConfig } = config;
    
      function updateCommon(sale, owner) {
    Severity: Minor
    Found in src/actions/sale/sync.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 getPendingAgreements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

    async function getPendingAgreements(ctx, query, opts = {}) {
      const { service, pulledUsers, missingUsers, pendingAgreements, agreementOwners } = ctx;
      const offset = opts.cursor || 0;
    
      const response = await service.dispatch('agreement.list', {
    Severity: Minor
    Found in src/actions/agreement/sync.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 calculateDiscounts has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    function calculateDiscounts(subscription, customSetupFee, skipSetupFee, trialDiscount, trialCycle) {
      const regularPayment = { ...subscription.definition.amount };
      const setupFee = { ...regularPayment };
      const extractCycle = skipSetupFee ? 0 : 1;
      const normalizedTrialCycle = subscription.name === 'year'
    Severity: Minor
    Found in src/actions/agreement/create.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

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

    function createSaveToRedis(redis, message) {
      return function saveToRedis(data) {
        const { plan, plans } = data;
        const { meta, level, title } = message;
        const aliasedId = message.alias || plan.id;
    Severity: Minor
    Found in src/actions/plan/create.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

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

    function updateRedis(sale) {
      const { redis } = this;
      const { state } = sale;
    
      if (state !== 'approved') {
    Severity: Minor
    Found in src/actions/sale/execute.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

    Parsing error: The keyword 'const' is reserved
    Open

    const { ActionTransport } = require('@microfleet/core');

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const Errors = require('common-errors');
    Severity: Minor
    Found in src/actions/agreement/get.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const { ActionTransport } = require('@microfleet/core');
    Severity: Minor
    Found in src/actions/hook/publish.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const { ActionTransport } = require('@microfleet/core');
    Severity: Minor
    Found in src/actions/plan/update.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const { ActionTransport } = require('@microfleet/core');
    Severity: Minor
    Found in src/actions/transaction/common.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const { ActionTransport } = require('@microfleet/core');

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const { ActionTransport } = require('@microfleet/core');
    Severity: Minor
    Found in src/actions/sale/createDynamic.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'class' is reserved
    Open

    class PublishingError extends Error {

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const { get } = require('lodash');
    Severity: Minor
    Found in src/utils/paypal/transactions.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const { ActionTransport } = require('@microfleet/core');
    Severity: Minor
    Found in src/actions/sale/get.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

    const { ActionTransport } = require('@microfleet/core');
    Severity: Minor
    Found in src/actions/sale/sync.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Parsing error: The keyword 'const' is reserved
    Open

      const { log, redis } = app;
    Severity: Minor
    Found in src/migrations/plan-titles/index.js by eslint

    For more information visit Source: http://eslint.org/docs/rules/

    Severity
    Category
    Status
    Source
    Language