rsercano/mongoclient

View on GitHub

Showing 331 of 698 total issues

Function getFlagValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  getFlagValue() {
    const twoSizesIndexes = UIComponents.Checkbox.getState($('#inputTwoSizesIndexes'));
    const noPadding = UIComponents.Checkbox.getState($('#inputNoPadding'));
    if (!twoSizesIndexes && !noPadding) return 0;
    if (twoSizesIndexes && !noPadding) return 1;
Severity: Minor
Found in client/imports/ui/collection/add.js - About 25 mins 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 execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      execute(historyParams) {
        let xAxis = historyParams ? historyParams.xAxis : $('#inputXAxis').val();
        if (xAxis) xAxis = parseInt(xAxis, 10);

        let yAxis = historyParams ? historyParams.yAxis : $('#inputYAxis').val();
Severity: Minor
Found in client/imports/ui/querying/querying.js - About 25 mins 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 initActionsForPrivilege has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  initActionsForPrivilege(actions) {
    Communicator.call({
      methodName: 'getAllActions',
      callback: (err, result) => {
        let data;
Severity: Minor
Found in client/imports/ui/user_management/roles.js - About 25 mins 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 getResource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  getResource(resource) {
    if (!resource) return '';
    if (resource.anyResource) return 'anyResource';
    if (resource.cluster) return 'cluster';
    if (resource.db && resource.collection) return `<b>${resource.collection}</b>@${resource.db}`;
Severity: Minor
Found in client/imports/ui/user_management/roles.js - About 25 mins 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 switchViewTo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  switchViewTo(whichToShow) {
    const jsonViews = $('div[id^="divActiveJsonEditor"]');
    if (whichToShow === 'jsonEditor') {
      jsonViews.show('slow');
    } else {
Severity: Minor
Found in client/imports/ui/querying/render.js - About 25 mins 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 startEditingRole has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  startEditingRole() {
    if (!SessionManager.get(SessionManager.strSessionUsermanagementPrivilege)) return;

    $('#addEditPrivilegeModalTitle').text(Helper.translate({ key: 'edit_privilege' }));
    $('#addEditPrivilegeModalText').text('');
Severity: Minor
Found in client/imports/ui/user_management/roles.js - About 25 mins 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 getActiveEditorValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  getActiveEditorValue() {
    const resultTabs = $('#resultTabs');
    const resultContents = $('#resultTabContents');

    const whichIsDisplayed = this.getWhichResultViewShowing();
Severity: Minor
Found in client/imports/ui/querying/render.js - About 25 mins 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 setQueryResult has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  setQueryResult(result, queryInfo, queryParams, saveHistory) {
    const isOnlyOneTab = $('#divActiveJsonEditor').css('display') === 'none'
      && $('#divActiveAceEditor').css('display') === 'none'
      && $('#divActiveGridEditor').css('display') === 'none';

Severity: Minor
Found in client/imports/ui/querying/render.js - About 25 mins 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 analyzeEditorValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  analyzeEditorValue(editorValue) {
    if (!editorValue) return;
    if (/find\(.*\).$/gi.test(editorValue)) return 'cursor';
    if (/db.$/gi.test(editorValue)) return 'db';
    if (/rs.$/gi.test(editorValue)) return 'replication';
Severity: Minor
Found in client/imports/ui/shell/index.js - About 25 mins 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 fetchStats has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  fetchStats() {
    if (SessionManager.get(SessionManager.strSessionCollectionNames)) {
      const settings = ReactivityProvider.findOne(ReactivityProvider.types.Settings);
      Communicator.call({
        methodName: 'dbStats',
Severity: Minor
Found in client/imports/ui/db_stats/index.js - About 25 mins 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 connect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  connect(isRefresh, message, messageTranslateOptions) {
    if (!SessionManager.get(SessionManager.strSessionConnection)) {
      Notification.warning('select-connection');
      return;
    }
Severity: Minor
Found in client/imports/ui/connection/index.js - About 25 mins 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

Severity
Category
Status
Source
Language