linagora/hublin

View on GitHub

Showing 306 of 306 total issues

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

  function canAddMember(req, res, next) {
    ensureUserAndConference(req);

    conference.userIsConferenceMember(req.conference, req.user, (err, isMember) => {
      if (err) {
Severity: Major
Found in backend/webserver/middlewares/conference.js and 2 other locations - About 2 hrs to fix
backend/webserver/middlewares/conference.js on lines 82..96
backend/webserver/middlewares/conference.js on lines 98..112

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

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

          process: function(res) {
            if (res.fail) {
              grunt.config.set('esn.tests.success', false);
              grunt.log.writeln('failed');
            } else {
Severity: Major
Found in Gruntfile.js and 2 other locations - About 2 hrs to fix
Gruntfile.js on lines 145..153
Gruntfile.js on lines 168..176

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

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

          process: function(res) {
            if (res.fail) {
              grunt.config.set('esn.tests.success', false);
              grunt.log.writeln('failed');
            } else {
Severity: Major
Found in Gruntfile.js and 2 other locations - About 2 hrs to fix
Gruntfile.js on lines 123..131
Gruntfile.js on lines 168..176

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

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

          process: function(res) {
            if (res.fail) {
              grunt.config.set('esn.tests.success', false);
              grunt.log.writeln('failed');
            } else {
Severity: Major
Found in Gruntfile.js and 2 other locations - About 2 hrs to fix
Gruntfile.js on lines 123..131
Gruntfile.js on lines 145..153

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

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

  SDPUtils.parseRtpEncodingParameters = function(mediaSection) {
    var encodingParameters = [];
    var description = SDPUtils.parseRtpParameters(mediaSection);
    var hasRed = description.fecMechanisms.indexOf('RED') !== -1;
    var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1;
Severity: Major
Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

    Function shimAddTrackRemoveTrackWithNative has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        shimAddTrackRemoveTrackWithNative: function(window) {
          // shim addTrack/removeTrack with native variants in order to make
          // the interactions with legacy getLocalStreams behave as in other browsers.
          // Keeps a mapping stream.id => [stream, rtpsenders...]
          window.RTCPeerConnection.prototype.getLocalStreams = function() {
    Severity: Major
    Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

      Function addIceCandidate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          RTCPeerConnection.prototype.addIceCandidate = function(candidate) {
            var sections;
            if (!candidate || candidate.candidate === '') {
              for (var j = 0; j < this.transceivers.length; j++) {
                if (this.transceivers[j].isDatachannel) {
      Severity: Major
      Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

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

              window.RTCPeerConnection.prototype.addIceCandidate = function() {
                if (!arguments[0]) {
                  if (arguments[1]) {
                    arguments[1].apply(null);
                  }
        Severity: Major
        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
        frontend/js/thirdparty/adapter.js on lines 3193..3201

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

        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

              window.RTCPeerConnection.prototype.addIceCandidate = function() {
                if (!arguments[0]) {
                  if (arguments[1]) {
                    arguments[1].apply(null);
                  }
        Severity: Major
        Found in frontend/js/thirdparty/adapter.js and 1 other location - About 2 hrs to fix
        frontend/js/thirdparty/adapter.js on lines 3871..3879

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

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

            RTCPeerConnection.prototype.createAnswer = function() {
              var pc = this;
        
              if (this._isClosed) {
                return Promise.reject(makeError('InvalidStateError',
        Severity: Major
        Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

          Function _gather has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              RTCPeerConnection.prototype._gather = function(mid, sdpMLineIndex) {
                var pc = this;
                var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer;
                if (iceGatherer.onlocalcandidate) {
                  return;
          Severity: Major
          Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

            Function getCommonCapabilities has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function getCommonCapabilities(localCapabilities, remoteCapabilities) {
                var commonCapabilities = {
                  codecs: [],
                  headerExtensions: [],
                  fecMechanisms: []
            Severity: Major
            Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

              Function conferenceUserVideo has 60 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function conferenceUserVideo($modal, currentConferenceState, matchmedia, LOCAL_VIDEO_ID) {
                  return {
                    restrict: 'E',
                    replace: true,
                    templateUrl: '/views/modules/conference/conference-user-video.html',
              Severity: Major
              Found in frontend/js/modules/conference/conference-user-video.directive.js - About 2 hrs to fix

                Function shimConstraints_ has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var shimConstraints_ = function(constraints, func) {
                      if (browserDetails.version >= 61) {
                        return func(constraints);
                      }
                      constraints = JSON.parse(JSON.stringify(constraints));
                Severity: Major
                Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                  Function exports has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function(grunt) {
                  
                    require('time-grunt')(grunt);
                  
                    grunt.initConfig({
                  Severity: Major
                  Found in Gruntfile-tests.js - About 2 hrs to fix

                    Function RTCPeerConnection has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var RTCPeerConnection = function(config) {
                          var pc = this;
                    
                          var _eventTarget = document.createDocumentFragment();
                          ['addEventListener', 'removeEventListener', 'dispatchEvent']
                    Severity: Major
                    Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                      Function shimOnTrack has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          shimOnTrack: function(window) {
                            if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in
                                window.RTCPeerConnection.prototype)) {
                              Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {
                                get: function() {
                      Severity: Major
                      Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                        Function getUserMedia_ has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            var getUserMedia_ = function(constraints, onSuccess, onError) {
                              var constraintsToFF37_ = function(c) {
                                if (typeof c !== 'object' || c.require) {
                                  return c;
                                }
                        Severity: Major
                        Found in frontend/js/thirdparty/adapter.js - About 2 hrs to fix

                          Function exports has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function(dependencies) {
                          
                            var wsserver = dependencies('wsserver');
                            var logger = dependencies('logger');
                            var pubsub = dependencies('pubsub');
                          Severity: Major
                          Found in backend/wsserver/notification/conference.js - About 2 hrs to fix

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

                              function scaleToCanvas($interval, $window, cropDimensions, drawAvatarIfVideoMuted, drawHelper, currentConferenceState) {
                                var requestAnimationFrame =
                                  $window.requestAnimationFrame ||
                                  $window.mozRequestAnimationFrame ||
                                  $window.msRequestAnimationFrame ||
                            Severity: Major
                            Found in frontend/js/modules/utils/scale-to-canvas.directive.js - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language