SimpliField/angular-sf-dragndrop

View on GitHub

Showing 5 of 9 total issues

Function DropDirective has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function DropDirective($parse, sfDragNDropService) {
  return {
    restrict: 'A',
    link: function($scope, element, attrs) {
      // Keep a ref to the dragged element
Severity: Major
Found in src/index.js - About 3 hrs to fix

    Function DragDirective has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function DragDirective($parse, sfDragNDropService) {
      return {
        restrict: 'A',
        link: function($scope, element, attrs) {
          // Keep a ref to the dragged model value
    Severity: Major
    Found in src/index.js - About 3 hrs to fix

      Function link has 74 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          link: function($scope, element, attrs) {
            // Keep a ref to the dragged element
               const item = $parse(attrs.sfDrop);
            // Setting callbacks
            const onDropCallback = $parse(attrs.sfOnDrop);
      Severity: Major
      Found in src/index.js - About 2 hrs to fix

        Function link has 72 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            link: function($scope, element, attrs) {
              // Keep a ref to the dragged model value
                 const item = $parse(attrs.sfDrag);
        
              // Try to get dragged datas
        Severity: Major
        Found in src/index.js - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                    if(-1 !== itemIndex) {
                      sfDragNDropService.session.itemIndex = itemIndex;
                      sfDragNDropService.session.item = draggedItem;
                      sfDragNDropService.session.type = attrs.sfDragType || 'all';
                      sfDragNDropService.session.mime = attrs.sfDragMime || 'text/plain';
          Severity: Major
          Found in src/index.js - About 1 hr to fix
            Severity
            Category
            Status
            Source
            Language