yoichiro/chrome_mysql_admin

View on GitHub
app/scripts/window/directives/er_diagram.js

Summary

Maintainability
F
4 days
Test Coverage

Function controller has 352 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        controller: ["$scope", function($scope) {
            $scope.drawModel = function(model, element) {
                if ($scope.positionProvider) {
                    $scope.positionProvider({
                        model: model,
Severity: Major
Found in app/scripts/window/directives/er_diagram.js - About 1 day to fix

    File er_diagram.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    (function() {
        "use strict";
    
        // --- Model
    
    
    Severity: Major
    Found in app/scripts/window/directives/er_diagram.js - About 1 day to fix

      Function drawEntity has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  var drawEntity = function(model, entity, x, y, element) {
                      var canvas = getCanvas(element);
      
                      // Event handlers
                      var onDragHandler = (function(model, element) {
      Severity: Major
      Found in app/scripts/window/directives/er_diagram.js - About 2 hrs to fix

        Function compile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                compile: function(element, attrs) {
                    setJCanvasDefaults();
                    return function(scope, element, attrs, ctrl) {
                        scope.$watch("model", (function(element) {
                            return function(newVal, oldVal) {
        Severity: Minor
        Found in app/scripts/window/directives/er_diagram.js - About 1 hr to fix

          Function drawConnection has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      var drawConnection = function(connection, element) {
                          var canvas = getCanvas(element);
                          var source = connection.getSource();
                          var sourceBorderLayer = canvas.getLayer(
                              source.getEntity().getName() + "-border");
          Severity: Minor
          Found in app/scripts/window/directives/er_diagram.js - About 1 hr to fix

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

                        var getStoredPositionCalculator = function(dimensions) {
                            return (function(dimensions) {
                                var offsetX = 30;
                                var offsetY = 30;
                                var existsPosition = false;
            Severity: Minor
            Found in app/scripts/window/directives/er_diagram.js - About 1 hr to fix

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

                          var getShortPosition = function(source, target) {
                              var source1 = source.x;
                              var source2 = source.x + source.width;
                              var target1 = target.x;
                              var target2 = target.x + target.width;
              Severity: Minor
              Found in app/scripts/window/directives/er_diagram.js - About 1 hr to fix

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

                            var getBasicPositionCalculator = function(model) {
                                return (function(model) {
                                    var startX = 30;
                                    var startY = 30;
                                    var offsetX = startX;
                Severity: Minor
                Found in app/scripts/window/directives/er_diagram.js - About 1 hr to fix

                  Function drawText has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                              var drawText = function(x, y, text, name, group, onDragHandler, onDragEndHandler, canvas) {
                  Severity: Major
                  Found in app/scripts/window/directives/er_diagram.js - About 1 hr to fix

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

                                var drawEntity = function(model, entity, x, y, element) {
                    Severity: Minor
                    Found in app/scripts/window/directives/er_diagram.js - About 35 mins to fix

                      There are no issues that match your filters.

                      Category
                      Status