cowbell/splittypie

View on GitHub

Showing 11 of 33 total issues

Function exports has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (defaults) {
    const app = new EmberApp(defaults, {
        "ember-cli-babel": {
            includePolyfill: true,
        },
Severity: Major
Found in ember-cli-build.js - About 2 hrs to fix

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

        outputReady(results) {
            const env = this.app.env;
    
            if (!(env === "production" || env === "staging")) {
                return true;
    Severity: Minor
    Found in lib/upload-rollbar-source-maps/index.js - About 1 hr to fix

      Function transfers has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          transfers: computed("users.@each.balance", function () {
              const users = get(this, "users");
              const currency = get(this, "users.firstObject.event.currency");
      
              const owed = users.filter(u => get(u, "balance") < 0).map(convertToUserAmount);
      Severity: Minor
      Found in app/components/settlement-transfer-list.js - About 1 hr to fix

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

        export default function parseTransaction(transactionText) {
            if (!transactionText || !transactionText.trim()) return null;
        
            const parts = transactionText.trim().split(" ");
            const onlyMePattern = /\.\s*me\s*$/;
        Severity: Minor
        Found in app/utils/parse-transaction.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 generateUniqueId has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function generateUniqueId() {
            let now = new Date().getTime();
            const duplicateTime = (now === lastPushTime);
            lastPushTime = now;
        
        
        Severity: Minor
        Found in app/utils/generate-unique-id.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 settleUp has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                settleUp(transfer) {
                    get(this, "modal").trigger("show", {
                        name: "settle-up",
                        actions: {
                            yes: () => {
        Severity: Minor
        Found in app/routes/event/index.js - About 1 hr to fix

          Function parseTransaction has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function parseTransaction(transactionText) {
              if (!transactionText || !transactionText.trim()) return null;
          
              const parts = transactionText.trim().split(" ");
              const onlyMePattern = /\.\s*me\s*$/;
          Severity: Minor
          Found in app/utils/parse-transaction.js - About 1 hr to fix

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

            export default function generateUniqueId() {
                let now = new Date().getTime();
                const duplicateTime = (now === lastPushTime);
                lastPushTime = now;
            
            
            Severity: Minor
            Found in app/utils/generate-unique-id.js - About 1 hr to fix

              Function initialize has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  initialize(application) {
                      const notify = application.__container__.lookup("service:notify");
              
                      if ("serviceWorker" in window.navigator) {
                          window.navigator.serviceWorker.register("/offline-support.js").then((registration) => {
              Severity: Minor
              Found in app/initializers/offline-support.js - About 1 hr to fix

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

                    transfers: computed("users.@each.balance", function () {
                        const users = get(this, "users");
                        const currency = get(this, "users.firstObject.event.currency");
                
                        const owed = users.filter(u => get(u, "balance") < 0).map(convertToUserAmount);
                Severity: Minor
                Found in app/components/settlement-transfer-list.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 reportError has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                function reportError(error) {
                    if (Ember.testing) {
                        throw error;
                    }
                
                
                Severity: Minor
                Found in app/initializers/rollbar.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

                Severity
                Category
                Status
                Source
                Language