rsercano/mongoclient

View on GitHub

Showing 698 of 698 total issues

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

  SelectParser.select_to_array = function(select) {
    var child, parser, _i, _len, _ref;
    parser = new SelectParser();
    _ref = select.childNodes;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
Severity: Major
Found in client/plugins/chosen_fork/chosen.proto.js and 1 other location - About 4 hrs to fix
client/plugins/chosen_fork/chosen.jquery.js on lines 109..118

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

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

  SelectParser.select_to_array = function(select) {
    var child, parser, _i, _len, _ref;
    parser = new SelectParser();
    _ref = select.childNodes;
    for (_i = 0, _len = _ref.length; _i < _len; _i++) {
Severity: Major
Found in client/plugins/chosen_fork/chosen.jquery.js and 1 other location - About 4 hrs to fix
client/plugins/chosen_fork/chosen.proto.js on lines 109..118

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

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

            function drawPie() {

                var startAngle = Math.PI * options.series.pie.startAngle;
                var 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 4 hrs to fix

    Function initRules has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

      initRules() {
        const selectedCollection = $('#validationRulesModal').data('collection');
        if (!selectedCollection) return;
    
        const connection = ReactivityProvider.findOne(ReactivityProvider.types.Connections, { _id: SessionManager.get(SessionManager.strSessionConnection)._id });
    Severity: Minor
    Found in client/imports/ui/collection/validation_rules.js - About 3 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

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

      loadSslCertificate(connection, prop, currentConnection, done) {
        if (connection[prop].certificateFileName) {
          Helper.loadFile(currentConnection[prop] ? currentConnection[prop].certificateFile : null, $('#inputCertificate'), (val) => {
            connection[prop].certificateFile = val;
            this.loadCertificateKeyFile(connection, prop, currentConnection, done);
    Severity: Major
    Found in client/imports/ui/connection/helper.js and 1 other location - About 3 hrs to fix
    client/imports/ui/connection/helper.js on lines 202..209

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

    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

      loadRootCa(connection, prop, currentConnection, done) {
        if (connection[prop].rootCAFileName) {
          Helper.loadFile(currentConnection[prop] ? currentConnection[prop].rootCAFile : null, $('#inputRootCA'), (val) => {
            connection[prop].rootCAFile = val;
            this.loadSslCertificate(connection, prop, currentConnection, done);
    Severity: Major
    Found in client/imports/ui/connection/helper.js and 1 other location - About 3 hrs to fix
    client/imports/ui/connection/helper.js on lines 193..200

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

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

                function plotLineArea(datapoints, axisx, axisy) {
                    var points = datapoints.points,
                        ps = datapoints.pointsize,
                        bottom = Math.min(Math.max(0, axisy.min), axisy.max),
                        i = 0, top, areaOpen = false,
    Severity: Major
    Found in client/plugins/flot/jquery.flot.js - About 3 hrs to fix

      Function setupTickGeneration has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function setupTickGeneration(axis) {
                  var opts = axis.options;
      
                  // estimate number of ticks
                  var noTicks;
      Severity: Major
      Found in client/plugins/flot/jquery.flot.js - About 3 hrs to fix

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

            spawned.stdout.on('data', Meteor.bindEnvironment((data) => {
              if (data.toString()) {
                Database.create({
                  type: Database.types.Dumps,
                  document: {
        Severity: Major
        Found in server/imports/core/mongodb/backup.js and 1 other location - About 3 hrs to fix
        server/imports/core/mongodb/index.js on lines 221..233

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

        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

              spawned.stderr.on('data', Meteor.bindEnvironment((data) => {
                if (data.toString()) {
                  Database.create({
                    type: Database.types.SchemaAnalyzeResult,
                    document: {
        Severity: Major
        Found in server/imports/core/mongodb/index.js and 1 other location - About 3 hrs to fix
        server/imports/core/mongodb/backup.js on lines 17..29

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

        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

          addFieldWeight(fieldName, val) {
            const divFieldWeight = $('.divFieldWeight:hidden');
            const cloned = divFieldWeight.clone();
        
            $('.divFieldWeight:last').after(cloned);
        Severity: Major
        Found in client/imports/ui/index_management/index.js and 1 other location - About 3 hrs to fix
        client/imports/ui/connection/index.js on lines 296..305

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

        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

          addServerField(host, port) {
            const divField = $('.divHostField:hidden');
            const cloned = divField.clone();
        
            $('.divHostField:last').after(cloned);
        Severity: Major
        Found in client/imports/ui/connection/index.js and 1 other location - About 3 hrs to fix
        client/imports/ui/index_management/index.js on lines 102..111

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

        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

            if (arg === '--query') {
              const query = ExtendedJSON.convertAndCheckJSON(UIComponents.Editor.getCodeMirrorValue($(`#mongo${operation}--query`)));
              if (query.ERROR) {
                Notification.error('syntax-error-query', null, { error: query.ERROR });
                result = null;
        Severity: Major
        Found in client/imports/ui/backup/index.js and 1 other location - About 3 hrs to fix
        client/imports/ui/backup/index.js on lines 21..27

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

        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 (arg === '--sort') {
              const sort = ExtendedJSON.convertAndCheckJSON(UIComponents.Editor.getCodeMirrorValue($(`#mongo${operation}--sort`)));
              if (sort.ERROR) {
                Notification.error('syntax-error-sort', null, { error: sort.ERROR });
                result = null;
        Severity: Major
        Found in client/imports/ui/backup/index.js and 1 other location - About 3 hrs to fix
        client/imports/ui/backup/index.js on lines 15..27

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

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

                function insertLegend() {
        
                    if (options.legend.container != null) {
                        $(options.legend.container).html("");
                    } else {
        Severity: Major
        Found in client/plugins/flot/jquery.flot.js - About 3 hrs to fix

          File jquery.flot.time.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* Pretty handling of time axes.
          
          Copyright (c) 2007-2014 IOLA and Ole Laursen.
          Licensed under the MIT license.
          
          
          Severity: Minor
          Found in client/plugins/flot/jquery.flot.time.js - About 3 hrs to fix

            Function register_observers has 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Chosen.prototype.register_observers = function() {
                  var _this = this;
                  this.container.observe("touchstart", function(evt) {
                    _this.container_mousedown(evt);
                    return evt.preventDefault();
            Severity: Major
            Found in client/plugins/chosen_fork/chosen.proto.js - About 3 hrs to fix

              `` has 28 functions (exceeds 20 allowed). Consider refactoring.
              Open

              Meteor.methods({
                profilingInfo({ sessionId }) {
                  const methodArray = [
                    {
                      profilingInfo: [],
              Severity: Minor
              Found in server/imports/methods/mongodb/collection.js - About 3 hrs to fix

                File helper.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { ReactivityProvider } from '/client/imports/facades';
                import { SessionManager, UIComponents } from '/client/imports/modules';
                import $ from 'jquery';
                import Helper from '../../helpers/helper';
                import { ReactiveVar } from 'meteor/reactive-var';
                Severity: Minor
                Found in client/imports/ui/connection/helper.js - About 3 hrs to fix

                  File index.js has 303 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { Database, Logger, Error } from '/server/imports/modules';
                  import ConnectionHelper from './helper';
                  
                  const fs = require('fs');
                  const mongodbUrlParser = require('mongodb-url');
                  Severity: Minor
                  Found in server/imports/core/connection/index.js - About 3 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language