yoichiro/chrome_mysql_admin

View on GitHub

Showing 375 of 375 total issues

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

        if ($scope.defaultValue) {
            if (typeService.isNumeric($scope.type)
                || $scope.type == 'TIMESTAMP' && $scope.defaultValue == "CURRENT_TIMESTAMP"
            ) {
                sql += "DEFAULT " + $scope.defaultValue + " ";
app/scripts/window/controllers/add_column_dialog_controller.js on lines 113..121

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 104.

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

        if ($scope.extra !== "NONE") {
            sql += $scope.extra;
            if ($scope.extra === "AUTO_INCREMENT") {
                if ($scope.key === "PRIMARY") {
                    sql += " PRIMARY KEY";
app/scripts/window/controllers/add_column_dialog_controller.js on lines 125..134

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 98.

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

        if ($scope.extra !== "NONE") {
            sql += $scope.extra;
            if ($scope.extra === "AUTO_INCREMENT") {
                if ($scope.key === "PRIMARY") {
                    sql += " PRIMARY KEY";
app/scripts/window/controllers/edit_column_dialog_controller.js on lines 234..243

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 98.

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

File constants.js has 295 lines of code (exceeds 250 allowed). Consider refactoring.
Open

chromeMyAdmin.constant("UIConstants", {
    GRID_COLUMN_MAX_WIDTH: 150,
    GRID_COLUMN_FONT_SIZE: 14,
    GRID_ROW_HEIGHT: 25,
    WINDOW_TITLE_PANEL_HEIGHT: 20,
Severity: Minor
Found in app/scripts/window/utils/constants.js - About 3 hrs to fix

    Function GBKDecoder has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function GBKDecoder(gb18030, options) {
        var fatal = options.fatal;
        var /** @type {number} */ gbk_first = 0x00,
            /** @type {number} */ gbk_second = 0x00,
            /** @type {number} */ gbk_third = 0x00;
    Severity: Major
    Found in app/scripts/lib/encoding.js - About 3 hrs to fix

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

          var showUpdateRowDialog = function() {
              loadTableStructure(function(columnDefinitions) {
                  if ($scope.lastQueryResult) {
                      var row = rowsSelectionService.getSelectedRows();
                      var originalRow = $scope.lastQueryResult.resultsetRows[row.rowIndex];
      Severity: Major
      Found in app/scripts/window/controllers/rows_panel_controller.js and 1 other location - About 3 hrs to fix
      app/scripts/window/controllers/rows_panel_controller.js on lines 328..339

      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 95.

      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

          var showCloneRowDialog = function() {
              loadTableStructure(function(columnDefinitions) {
                  if ($scope.lastQueryResult) {
                      var row = rowsSelectionService.getSelectedRows();
                      var originalRow = $scope.lastQueryResult.resultsetRows[row.rowIndex];
      Severity: Major
      Found in app/scripts/window/controllers/rows_panel_controller.js and 1 other location - About 3 hrs to fix
      app/scripts/window/controllers/rows_panel_controller.js on lines 341..352

      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 95.

      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

      File mysql_client_service.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      chromeMyAdmin.factory("mySQLClientService", function(
          $q,
          $rootScope
      ) {
          "use strict";
      Severity: Minor
      Found in app/scripts/window/services/mysql_client_service.js - About 3 hrs to fix

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

            var setupItems = function() {
                $scope.types = typeService.getTypes();
                $scope.type = "VARCHAR";
                $scope.extras = ["NONE", "AUTO_INCREMENT",
                                 "ON UPDATE CURRENT_TIMESTAMP", "SERIAL DEFAULT VALUE"];
        app/scripts/window/controllers/edit_column_dialog_controller.js on lines 140..148

        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 94.

        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

            var setupItems = function() {
                $scope.types = typeService.getTypes();
                $scope.type = "VARCHAR";
                $scope.extras = ["NONE", "AUTO_INCREMENT",
                                 "ON UPDATE CURRENT_TIMESTAMP", "SERIAL DEFAULT VALUE"];
        app/scripts/window/controllers/add_column_dialog_controller.js on lines 39..47

        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 94.

        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 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 decode has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.decode = function(byte_pointer) {
                var bite = byte_pointer.get();
                if (bite === EOF_byte && gbk_first === 0x00 &&
                    gbk_second === 0x00 && gbk_third === 0x00) {
                  return EOF_code_point;
          Severity: Major
          Found in app/scripts/lib/encoding.js - About 2 hrs to fix

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

                $scope.editColumn = function() {
                    if ($scope.type === "SET" || $scope.type === "ENUM") {
                        if ($scope.setEnumValues.length === 0) {
                            $scope.errorMessage = "SET/ENUM type column must have one or more values.";
                            return;
            Severity: Major
            Found in app/scripts/window/controllers/edit_column_dialog_controller.js - About 2 hrs to fix

              File export_all_databases_service.js has 286 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              chromeMyAdmin.factory("exportAllDatabasesService", function(
                  $rootScope,
                  $q,
                  Events,
                  mySQLClientService,
              Severity: Minor
              Found in app/scripts/window/services/export_all_databases_service.js - About 2 hrs to fix

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

                      case state.escape_middle:
                        if (bite === 0x29) {
                          iso2022kr_state = state.escape_end;
                          return null;
                        }
                Severity: Major
                Found in app/scripts/lib/encoding.js and 1 other location - About 2 hrs to fix
                app/scripts/lib/encoding.js on lines 1984..1995

                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 92.

                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

                      case state.escape_end:
                        if (bite === 0x43) {
                          iso2022kr_state = state.ASCII;
                          return null;
                        }
                Severity: Major
                Found in app/scripts/lib/encoding.js and 1 other location - About 2 hrs to fix
                app/scripts/lib/encoding.js on lines 1972..1983

                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 92.

                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 addColumn has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    $scope.addColumn = function() {
                        if ($scope.type === "SET" || $scope.type === "ENUM") {
                            if ($scope.setEnumValues.length === 0) {
                                $scope.errorMessage = "SET/ENUM type column must have one or more values.";
                                return;
                Severity: Major
                Found in app/scripts/window/controllers/add_column_dialog_controller.js - About 2 hrs to fix

                  File login_form_controller.js has 283 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  chromeMyAdmin.controller("LoginFormController", function(
                      $scope,
                      $timeout,
                      mySQLClientService,
                      favoriteService,
                  Severity: Minor
                  Found in app/scripts/window/controllers/login_form_controller.js - About 2 hrs to fix

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

                        $scope.aceLoaded = function(editor) {
                            $scope.editor = editor;
                            editor.setHighlightActiveLine(false);
                            editor.setShowPrintMargin(false);
                            editor.setShowInvisibles(true);
                    app/scripts/window/controllers/procedures_functions_panel_controller.js on lines 330..337

                    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 90.

                    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.aceLoaded = function(editor) {
                            $scope.editor = editor;
                            editor.setHighlightActiveLine(false);
                            editor.setShowPrintMargin(false);
                            editor.setShowInvisibles(true);
                    app/scripts/window/controllers/information_panel_controller.js on lines 177..184

                    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 90.

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language