yoichiro/chrome_mysql_admin

View on GitHub

Showing 375 of 375 total issues

Function parseForeignKeysFromCreateTableDdl has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var parseForeignKeysFromCreateTableDdl = function(ddl) {
        var result = [];
        var lines = ddl.split("\n");
        angular.forEach(lines, function(line) {
            line = line.trim();
Severity: Minor
Found in app/scripts/window/services/relation_service.js - About 1 hr to fix

    Function assignEventHandlers has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var assignEventHandlers = function() {
            $scope.$on(Events.FAVORITE_SELECTED, function(event, favorite) {
                $scope.safeApply(function() {
                    $scope.name = favorite.name;
                    $scope.hostName = favorite.hostName;
    Severity: Minor
    Found in app/scripts/window/controllers/login_form_controller.js - About 1 hr to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          $scope.deleteSetEnumValue = function(value) {
              var index = $scope.setEnumValues.indexOf(value);
              if (index !== -1) {
                  $scope.setEnumValues.splice(index, 1);
              }
      app/scripts/window/controllers/add_column_dialog_controller.js on lines 171..176

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 65.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          $scope.deleteSetEnumValue = function(value) {
              var index = $scope.setEnumValues.indexOf(value);
              if (index !== -1) {
                  $scope.setEnumValues.splice(index, 1);
              }
      app/scripts/window/controllers/edit_column_dialog_controller.js on lines 279..284

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 65.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function assignEventHandlers has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var assignEventHandlers = function() {
              $scope.$on(Events.MODE_CHANGED, function(event, mode) {
                  onModeChanged(mode);
              });
              $scope.$on(Events.CONNECTION_CHANGED, function(event, data) {
      Severity: Minor
      Found in app/scripts/window/controllers/er_diagram_panel_controller.js - About 1 hr to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                } else if ($scope.keyType === "UNIQUE") {
                    sql += "ALTER TABLE `" + $scope.selectedTable.name + "` ADD UNIQUE INDEX ";
                    if ($scope.keyName) {
                        sql += "`" + $scope.keyName + "` ";
                    }
        app/scripts/window/controllers/add_index_dialog_controller.js on lines 110..122

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 64.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                } else if ($scope.keyType === "INDEX") {
                    sql += "ALTER TABLE `" + $scope.selectedTable.name + "` ADD INDEX ";
                    if ($scope.keyName) {
                        sql += "`" + $scope.keyName + "` ";
                    }
        app/scripts/window/controllers/add_index_dialog_controller.js on lines 116..122

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 64.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function decode has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            decode: function decode(opt_view, options) {
              if (opt_view && !('buffer' in opt_view && 'byteOffset' in opt_view &&
                                'byteLength' in opt_view)) {
                throw new TypeError('Expected ArrayBufferView');
              } else if (!opt_view) {
        Severity: Minor
        Found in app/scripts/lib/encoding.js - About 1 hr to fix

          Function decode has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.decode = function(byte_pointer) {
                var bite = byte_pointer.get();
                if (bite === EOF_byte && shiftjis_lead === 0x00) {
                  return EOF_code_point;
                }
          Severity: Minor
          Found in app/scripts/lib/encoding.js - About 1 hr to fix

            Function onShowDialog has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var onShowDialog = function() {
                    resetErrorMessage();
                    $scope.matchingType = "Full";
                    $scope.removeEmptyResult = "true";
                    var table = targetObjectService.getTable();
            Severity: Minor
            Found in app/scripts/window/controllers/find_same_rows_dialog_controller.js - About 1 hr to fix

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

                function HZGB2312Encoder(options) {
                  var fatal = options.fatal;
                  var hzgb2312 = false;
                  /**
                   * @param {ByteOutputStream} output_byte_stream Output byte stream.
              Severity: Minor
              Found in app/scripts/lib/encoding.js - About 1 hr 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

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      $scope.targetInputColumns = function() {
                          var result = [];
                          angular.forEach($scope.columnDefinitions, function(column) {
                              // TODO filter
                              result.push(column);
                  app/scripts/window/controllers/insert_row_dialog_controller.js on lines 63..70

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                      $scope.targetInputColumns = function() {
                          var result = [];
                          angular.forEach($scope.columnDefinitions, function(column) {
                              // TODO filter
                              result.push(column);
                  app/scripts/window/controllers/update_row_dialog_controller.js on lines 52..59

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 63.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Function getProcedureParameters has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var getProcedureParameters = function(routineCode) {
                          var start = routineCode.indexOf("(") + 1;
                          var cnt = 0;
                          var end = -1;
                          for (var i = start; i < routineCode.length; i++) {

                    Similar blocks of code found in 4 locations. Consider refactoring.
                    Open

                        var adjustLoginFormHeight = function() {
                            $("#loginForm").height(
                                $(window).height() -
                                    UIConstants.WINDOW_TITLE_PANEL_HEIGHT -
                                    UIConstants.NAVBAR_HEIGHT -
                    Severity: Major
                    Found in app/scripts/window/controllers/login_form_controller.js and 3 other locations - About 1 hr to fix
                    app/scripts/window/controllers/er_diagram_panel_controller.js on lines 178..184
                    app/scripts/window/controllers/relation_panel_controller.js on lines 66..72
                    app/scripts/window/main.js on lines 127..133

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 4 locations. Consider refactoring.
                    Open

                        var adjustMainPanelHeight = function() {
                            $("#mainPanel").height(
                                $(window).height() -
                                    UIConstants.WINDOW_TITLE_PANEL_HEIGHT -
                                    UIConstants.NAVBAR_HEIGHT -
                    Severity: Major
                    Found in app/scripts/window/main.js and 3 other locations - About 1 hr to fix
                    app/scripts/window/controllers/er_diagram_panel_controller.js on lines 178..184
                    app/scripts/window/controllers/login_form_controller.js on lines 37..43
                    app/scripts/window/controllers/relation_panel_controller.js on lines 66..72

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 4 locations. Consider refactoring.
                    Open

                        var adjustCanvasContainerHeight = function() {
                            $("#erDiagramPanel").height(
                                $(window).height() -
                                    UIConstants.WINDOW_TITLE_PANEL_HEIGHT -
                                    UIConstants.NAVBAR_HEIGHT -
                    app/scripts/window/controllers/login_form_controller.js on lines 37..43
                    app/scripts/window/controllers/relation_panel_controller.js on lines 66..72
                    app/scripts/window/main.js on lines 127..133

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 4 locations. Consider refactoring.
                    Open

                        var adjustRelationPanelHeight = function() {
                            $("#relationGrid").height(
                                $(window).height() -
                                    UIConstants.WINDOW_TITLE_PANEL_HEIGHT -
                                    UIConstants.NAVBAR_HEIGHT -
                    app/scripts/window/controllers/er_diagram_panel_controller.js on lines 178..184
                    app/scripts/window/controllers/login_form_controller.js on lines 37..43
                    app/scripts/window/main.js on lines 127..133

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 62.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

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

                        $scope.addIndex = function() {
                            resetErrorMessage();
                            var sql = "";
                            var columnListString = "(" + createColumnListString($scope.selectedColumns) + ")";
                            if ($scope.keyType === "PRIMARY") {
                    Severity: Minor
                    Found in app/scripts/window/controllers/add_index_dialog_controller.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language