vmpowerio/ember-notification-hub

View on GitHub

Showing 5 of 5 total issues

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

    _pushTaskNotification: function (notification) {
        notification.set('status', 'Pending');
        this.get('notifications').unshiftObject(notification);
        notification.promise.then(() => {
                Ember.debug('setting succeeded');
Severity: Minor
Found in addon/services/ember-notification-center.js - About 1 hr to fix

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

        lastNotificationObserver: Ember.observer('lastNotification', target => {
            if (target.get('firstTime')) {
                target.set('firstTime', false);
                return;
            }
    Severity: Minor
    Found in addon/components/ember-notification-center.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 lastNotificationObserver has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        lastNotificationObserver: Ember.observer('lastNotification', target => {
            if (target.get('firstTime')) {
                target.set('firstTime', false);
                return;
            }
    Severity: Minor
    Found in addon/components/ember-notification-center.js - About 1 hr to fix

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

      module.exports = function (defaults) {
          var app = new EmberAddon(defaults, {
              nodeSass: nodeSass,
              includePaths: [
                'app/styles'
      Severity: Minor
      Found in ember-cli-build.js - About 1 hr to fix

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

            _pushTaskNotification: function (notification) {
                notification.set('status', 'Pending');
                this.get('notifications').unshiftObject(notification);
                notification.promise.then(() => {
                        Ember.debug('setting succeeded');
        Severity: Minor
        Found in addon/services/ember-notification-center.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

        Severity
        Category
        Status
        Source
        Language