linagora/hublin

View on GitHub

Showing 306 of 306 total issues

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

module.exports = function(wsserver) {

  var auth = function(socket, callback) {
    var infos = wsserver.helper.getInfos(socket);
    if (!infos || !infos.query) {
Severity: Minor
Found in backend/wsserver/auth.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

Parsing error: Unexpected token )
Open

module.exports = () => ({
Severity: Minor
Found in fixtures/esn-config/data/session.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Unexpected alias 'user' for 'this'.
Open

  var user = this;
Severity: Minor
Found in backend/core/db/mongo/models/user.js by eslint

Require Consistent This (consistent-this)

It is often necessary to capture the current execution context in order to make it available subsequently. A prominent example of this are jQuery callbacks:

var that = this;
jQuery('li').click(function (event) {
    // here, "this" is the HTMLElement where the click event occurred
    that.setFoo(42);
});

There are many commonly used aliases for this such as that, self or me. It is desirable to ensure that whichever alias the team agrees upon is used consistently throughout the application.

Rule Details

This rule enforces two things about variables with the designated alias names for this:

  • If a variable with a designated name is declared, it must be either initialized (in the declaration) or assigned (in the same scope as the declaration) the value this.
  • If a variable is initialized or assigned the value this, the name of the variable must be a designated alias.

Options

This rule has one or more string options:

  • designated alias names for this (default "that")

Examples of incorrect code for this rule with the default "that" option:

/*eslint consistent-this: ["error", "that"]*/

var that = 42;

var self = this;

that = 42;

self = this;

Examples of correct code for this rule with the default "that" option:

/*eslint consistent-this: ["error", "that"]*/

var that = this;

var self = 42;

var self;

that = this;

foo.bar = this;

Examples of incorrect code for this rule with the default "that" option, if the variable is not initialized:

/*eslint consistent-this: ["error", "that"]*/

var that;
function f() {
    that = this;
}

Examples of correct code for this rule with the default "that" option, if the variable is not initialized:

/*eslint consistent-this: ["error", "that"]*/

var that;
that = this;

var foo, that;
foo = 42;
that = this;

When Not To Use It

If you need to capture nested context, consistent-this is going to be problematic. Code of that nature is usually difficult to read and maintain and you should consider refactoring it. Source: http://eslint.org/docs/rules/

Parsing error: Unexpected token )
Open

module.exports = () => ({
Severity: Minor
Found in fixtures/esn-config/data/login.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: Unexpected token )
Open

module.exports = () => ({
Severity: Minor
Found in fixtures/esn-config/data/web.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

  const denormalizer = require('../denormalizers/conference')(dependencies);

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const i18n = require('i18n');
Severity: Minor
Found in backend/core/i18n/index.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const i18n = require('../core/i18n');
Severity: Minor
Found in backend/i18n/index.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const async = require('async');
Severity: Minor
Found in server.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const mongoose = require('mongoose');

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const views = require('./views');
Severity: Minor
Found in backend/webserver/application.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const TimelineEntrySchema = require('../schemas/timelineentry');

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const extend = require('extend');
Severity: Minor
Found in backend/core/conference/index.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const host = process.env.REDIS_HOST || 'localhost';
Severity: Minor
Found in fixtures/esn-config/data/redis.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const Q = require('q');

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: Unexpected token ,
Open

          meetings,
Severity: Minor
Found in backend/index.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const fs = require('fs');
Severity: Minor
Found in fixtures/esn-config/index.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const janusHost = process.env.HUBLIN_JANUS_HOST || 'localhost';

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const server = require('../config/db.json');
Severity: Minor
Found in fixtures/index.js by eslint

For more information visit Source: http://eslint.org/docs/rules/

Parsing error: The keyword 'const' is reserved
Open

const config = require('../esn-config');

For more information visit Source: http://eslint.org/docs/rules/

Severity
Category
Status
Source
Language