rsercano/mongoclient

View on GitHub

Showing 331 of 698 total issues

Function DBStats has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const DBStats = function () {
  this.interval = null;
  this.memoryChart = null;
  this.connectionsChart = null;
  this.networkChart = null;
Severity: Major
Found in client/imports/ui/db_stats/index.js - About 2 hrs to fix

    prototype has 21 functions (exceeds 20 allowed). Consider refactoring.
    Open

    UserManagementRoles.prototype = {
      addInheritRole() {
        const db = $('#cmbDatabasesForInheritRole').val();
        const role = $('#cmbRolesForDBForInheritedRole').val();
    
    
    Severity: Minor
    Found in client/imports/ui/user_management/roles.js - About 2 hrs to fix

      Function zoom has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              plot.zoom = function (args) {
                  if (!args)
                      args = {};
                  
                  var c = args.center,
      Severity: Major
      Found in client/plugins/flot/jquery.flot.navigate.js - About 2 hrs to fix

        Function toString has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            toString: function(format, translateAlias) {
              format = format || this.origFormat || this.fallbackFormat;
              translateAlias = translateAlias || false;
        
              var c = false;
        Severity: Major
        Found in client/plugins/colorpicker/js/bootstrap-colorpicker.js - About 2 hrs to fix

          Function initOptions has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            initOptions(optionEnum, showRunOnAdmin, ...excludedOptions) {
              switch (optionEnum) {
                case Enums.ADD_USER_OPTIONS:
                  initOptions.call(this, $('#cmbAddUserOptions'), Enums.ADD_USER_OPTIONS, showRunOnAdmin, ...excludedOptions);
                  break;
          Severity: Major
          Found in client/imports/ui/querying/querying.js - About 2 hrs to fix

            Function redirect has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

              redirect() {
                let query;
                if (this.selectedOption === '1') query = `{ ${this.fieldName}:{ $exists: true }}`;
                else if (this.selectedOption === '2') {
                  this.regexOptions = this.regexOptions ? this.regexOptions.join('') : '';
            Severity: Minor
            Found in client/imports/ui/querying/wizard.js - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function findNearbySlice has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function findNearbySlice(mouseX, mouseY) {
            
                        var slices = plot.getData(),
                            options = plot.getOptions(),
                            radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius,
            Severity: Major
            Found in client/plugins/flot/jquery.flot.pie.js - About 2 hrs to fix

              Function fillInSeriesOptions has 51 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      function fillInSeriesOptions() {
              
                          var neededColors = series.length, maxIndex = -1, i;
              
                          // Subtract the number of series that already have fixed colors or
              Severity: Major
              Found in client/plugins/flot/jquery.flot.js - About 2 hrs to fix

                Function getConnectionUrl has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  getConnectionUrl(connection, username, password, addAuthSource, keepDB) {
                    if (connection.url) {
                      if (username || password) ConnectionHelper.changeUsernameAndPasswordFromConnectionUrl(connection, username, password);
                      if (!keepDB) ConnectionHelper.extractDBFromConnectionUrl(connection);
                      else ConnectionHelper.putCorrectDBToConnectionUrl(connection);
                Severity: Minor
                Found in server/imports/core/connection/index.js - About 2 hrs to fix

                  Function initFilesInformation has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    initFilesInformation() {
                      Notification.start('#btnReloadFiles');
                  
                      let selector = UIComponents.Editor.getCodeMirrorValue($('#divSelector'));
                      selector = ExtendedJSON.convertAndCheckJSON(selector);
                  Severity: Minor
                  Found in client/imports/ui/file_management/index.js - About 2 hrs to fix

                    Function drawLabels has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    function drawLabels() {
                    
                                        var currentAngle = startAngle;
                                        var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius;
                    
                    
                    Severity: Minor
                    Found in client/plugins/flot/jquery.flot.pie.js - About 1 hr to fix

                      Function mousemove has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          mousemove: function(e) {
                            if (!e.pageX && !e.pageY && e.originalEvent && e.originalEvent.touches) {
                              e.pageX = e.originalEvent.touches[0].pageX;
                              e.pageY = e.originalEvent.touches[0].pageY;
                            }
                      Severity: Minor
                      Found in client/plugins/colorpicker/js/bootstrap-colorpicker.js - About 1 hr to fix

                        Function initUserTree has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          initUserTree() {
                            this.defaultInformationText = Helper.translate({ key: 'user_management_default_tree_text' });
                            SessionManager.set(SessionManager.strSessionUsermanagementInfo, '');
                            SessionManager.set(SessionManager.strSessionSelectionUserManagement, this.defaultInformationText);
                            $('#btnEditUser').hide();
                        Severity: Minor
                        Found in client/imports/ui/user_management/tree.js - About 1 hr to fix

                          Function gatherOptions has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                            gatherOptions() {
                              const options = this.getOptions();
                              if (options.ERROR) {
                                Notification.error(options.ERROR);
                                return;
                          Severity: Minor
                          Found in client/imports/ui/collection/add.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function getFindModifyFinalObject has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const getFindModifyFinalObject = function (queryStr) {
                            return {
                              execute(historyParams) {
                                const options = historyParams ? historyParams.options : QueryingOptions.getOptions(Enums.FINDONE_MODIFY_OPTIONS);
                                const selector = getFromHistoryOrEditor(historyParams, $('#divSelector'));
                          Severity: Minor
                          Found in client/imports/ui/querying/querying.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function populateConnectionsTable has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                          Open

                            populateConnectionsTable() {
                              UIComponents.DataTable.setupDatatable({
                                selectorString: '#tblConnection',
                                extraOptions: {
                                  createdRow(row, data) {
                          Severity: Minor
                          Found in client/imports/ui/connection/index.js - About 1 hr to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function executeBinary has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const executeBinary = function (args, sessionId, binaryName) {
                            const binaryPath = MongoDBHelper.getProperBinary(binaryName);
                            const metadataToLog = { args, sessionId, binaryPath };
                            Logger.info({ message: `${binaryName}`, metadataToLog });
                          
                          
                          Severity: Minor
                          Found in server/imports/core/mongodb/backup.js - About 1 hr to fix

                            Function setupGrid has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    function setupGrid() {
                                        var i, axes = allAxes(), showGrid = options.grid.show;
                            
                                        // Initialize the plot's offset from the edge of the canvas
                            
                            
                            Severity: Minor
                            Found in client/plugins/flot/jquery.flot.js - About 1 hr to fix

                              Function Error has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const Error = function Error() {
                                this.types = {
                                  ParseUrlError: {
                                    Exception: Meteor.Error.bind(this, 1000),
                                    message: 'parse-url-error'
                              Severity: Minor
                              Found in server/imports/modules/error_handler/index.js - About 1 hr to fix

                                Function saveFindEditor has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  saveFindEditor() {
                                    const activeTab = $('#resultTabs').find('li.active').find('a').attr('href');
                                    const findData = $(activeTab).data('findData');
                                    if (!findData) {
                                      Notification.error('no-result-found-to-save');
                                Severity: Minor
                                Found in client/imports/ui/querying/save_editor.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language