linagora/hublin

View on GitHub

Showing 306 of 306 total issues

Function invite has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

function invite(conference, creator, members, baseUrl, callback) {
Severity: Minor
Found in backend/core/conference/index.js - About 35 mins to fix

    Function conferenceMobileVideo has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      function conferenceMobileVideo($timeout, $window, $rootScope, drawVideo, currentConferenceState) {
    Severity: Minor
    Found in frontend/js/modules/conference/conference-mobile-video.directive.js - About 35 mins to fix

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

      module.exports = function(dependencies) {
        'use strict';
      
        var logger = dependencies('logger');
      
      
      Severity: Minor
      Found in backend/webserver/errors.js - About 35 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 exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      module.exports = dependencies => {
        const logger = dependencies('logger');
        const config = require('../../core/esn-config');
      
        return {
      Severity: Minor
      Found in backend/webserver/denormalizers/conference.js - About 35 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

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

            usernameFragment: lines.filter(function(line) {
              return line.indexOf('a=ice-ufrag:') === 0;
            })[0].substr(12),
      Severity: Minor
      Found in frontend/js/thirdparty/adapter.js and 1 other location - About 35 mins to fix
      frontend/js/thirdparty/adapter.js on lines 1950..1952

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

      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

            password: lines.filter(function(line) {
              return line.indexOf('a=ice-pwd:') === 0;
            })[0].substr(10)
      Severity: Minor
      Found in frontend/js/thirdparty/adapter.js and 1 other location - About 35 mins to fix
      frontend/js/thirdparty/adapter.js on lines 1947..1949

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

      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

      Avoid too many return statements within this function.
      Open

        return true;
      Severity: Major
      Found in backend/core/db/mongo/schemas/tuple.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return false;
        Severity: Major
        Found in frontend/js/thirdparty/modernizr.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return adapter;
          Severity: Major
          Found in frontend/js/thirdparty/adapter.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                          return Promise.reject(makeError('OperationError',
                              'Can not add ICE candidate'));
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                        return Promise.reject(makeError('OperationError',
                            'Can not add ICE candidate'));
              Severity: Major
              Found in frontend/js/thirdparty/adapter.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return Promise.resolve();
                Severity: Major
                Found in frontend/js/thirdparty/adapter.js - About 30 mins to fix

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

                  function ForbiddenError(details) {
                    Error.captureStackTrace(this, arguments.callee); // jshint ignore:line
                    HttpError.call(this, 403, 'Forbidden', details);
                  }
                  Severity: Major
                  Found in backend/webserver/errors.js and 3 other locations - About 30 mins to fix
                  backend/webserver/errors.js on lines 62..65
                  backend/webserver/errors.js on lines 86..89
                  backend/webserver/errors.js on lines 98..101

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

                  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 4 locations. Consider refactoring.
                  Open

                  function BadRequestError(details) {
                    Error.captureStackTrace(this, arguments.callee); // jshint ignore:line
                    HttpError.call(this, 400, 'Bad Request', details);
                  }
                  Severity: Major
                  Found in backend/webserver/errors.js and 3 other locations - About 30 mins to fix
                  backend/webserver/errors.js on lines 74..77
                  backend/webserver/errors.js on lines 86..89
                  backend/webserver/errors.js on lines 98..101

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

                  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

                          socket.on('subscribe', function(uuid) {
                            logger.info('User', userId, ': joining room /', NAMESPACE, '/', uuid);
                            socket.join(uuid);
                          });
                  Severity: Minor
                  Found in backend/wsserver/notification/conference.js and 1 other location - About 30 mins to fix
                  backend/wsserver/notification/conference.js on lines 77..80

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

                  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 4 locations. Consider refactoring.
                  Open

                  function NotFoundError(details) {
                    Error.captureStackTrace(this, arguments.callee); // jshint ignore:line
                    HttpError.call(this, 404, 'Not Found', details);
                  }
                  Severity: Major
                  Found in backend/webserver/errors.js and 3 other locations - About 30 mins to fix
                  backend/webserver/errors.js on lines 62..65
                  backend/webserver/errors.js on lines 74..77
                  backend/webserver/errors.js on lines 98..101

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

                  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 4 locations. Consider refactoring.
                  Open

                  function ServerError(details) {
                    Error.captureStackTrace(this, arguments.callee); // jshint ignore:line
                    HttpError.call(this, 500, 'Internal Server Error', details);
                  }
                  Severity: Major
                  Found in backend/webserver/errors.js and 3 other locations - About 30 mins to fix
                  backend/webserver/errors.js on lines 62..65
                  backend/webserver/errors.js on lines 74..77
                  backend/webserver/errors.js on lines 86..89

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

                  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

                          socket.on('unsubscribe', function(uuid) {
                            logger.info('User', userId, ': leaving room /', NAMESPACE, '/', uuid);
                            socket.leave(uuid);
                          });
                  Severity: Minor
                  Found in backend/wsserver/notification/conference.js and 1 other location - About 30 mins to fix
                  backend/wsserver/notification/conference.js on lines 72..75

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

                  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 mongooseConnect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function mongooseConnect(reinit) {
                    var defaultConfig = config('default');
                    if (defaultConfig.db && defaultConfig.db.reconnectOnConfigurationChange) {
                      if (!dbConfigWatcher) {
                        dbConfigWatcher = configurationWatcher(logger, getDbConfigurationFile(), reinit);
                  Severity: Minor
                  Found in backend/core/db/mongo/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 load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  module.exports.load = function(config) {
                  
                    var winstonLogger = getNewLogger();
                  
                    if (!config || config.length === 0) {
                  Severity: Minor
                  Found in backend/logger/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