Foxandxss/angular-toastr

View on GitHub
src/toastr.js

Summary

Maintainability
D
2 days
Test Coverage

Function toastr has 227 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function toastr($animate, $injector, $rootScope, $sce, toastrConfig, $q) {
    var container;
    var index = 0;
    var toasts = [];

Severity: Major
Found in src/toastr.js - About 1 day to fix

    Function _notify has 109 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function _notify(map) {
          var options = _getOptions();
    
          if (shouldExit()) { return; }
    
    
    Severity: Major
    Found in src/toastr.js - About 4 hrs to fix

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

            function createScope(toast, map, options) {
              if (options.allowHtml) {
                toast.scope.allowHtml = true;
                toast.scope.title = $sce.trustAsHtml(map.title);
                toast.scope.message = $sce.trustAsHtml(map.message);
      Severity: Minor
      Found in src/toastr.js - About 1 hr to fix

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

            function remove(toastId, wasClicked) {
              var toast = findToast(toastId);
        
              if (toast && ! toast.deleting) { // Avoid clicking when fading out
                toast.deleting = true;
        Severity: Minor
        Found in src/toastr.js - About 1 hr to fix

          Function toastr has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            function toastr($animate, $injector, $rootScope, $sce, toastrConfig, $q) {
          Severity: Minor
          Found in src/toastr.js - About 45 mins to fix

            There are no issues that match your filters.

            Category
            Status