aullman/opentok-meet

View on GitHub

Showing 34 of 40 total issues

Function RoomCtrl has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

  function RoomCtrl($scope, $http, $window, $document, $timeout, OTSession, RoomService, baseURL, NotificationService) {
    $scope.streams = OTSession.streams;
    $scope.connections = OTSession.connections;
    $scope.publishing = false;
    $scope.archiveId = null;
Severity: Minor
Found in src/js/controllers.js - About 1 hr 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 link has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function link(scope, element) {
    let currentPublisher;
    scope.devices = [];
    scope.showDeviceList = false;
    scope.selectedLabel = '';
Severity: Minor
Found in src/js/microphone-picker.js - About 1 hr to fix

    Function MicrophonePickerDirective has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    function MicrophonePickerDirective() {
      function link(scope, element) {
        let currentPublisher;
        scope.devices = [];
        scope.showDeviceList = false;
    Severity: Minor
    Found in src/js/microphone-picker.js - About 1 hr 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 toggleFilterList has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        scope.toggleFilterList = () => {
          scope.showFilterList = !scope.showFilterList;
    
          setTimeout(() => {
            // Do it asynchronously so we don't block
    Severity: Minor
    Found in src/js/filter-picker.js - About 1 hr to fix

      Function mappedStats has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              const mappedStats = allStats.map((statsContainer) => {
                const { stats } = statsContainer;
                const key = statsContainer.subscriberId || 'Mantis';
      
                if (!allLastStats[key]) {
      Severity: Minor
      Found in src/js/publisher-stats.js - About 1 hr to fix

        Function subscriberStats has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          '$timeout', function subscriberStats(OTSession, StatsService, $timeout) {
            return {
              restrict: 'E',
              scope: {
                stream: '=',
        Severity: Minor
        Found in src/js/subscriber-stats.js - About 1 hr to fix

          Function mutePublisher has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            .directive('mutePublisher', ['OTSession', function mutePublisher(OTSession) {
              return {
                restrict: 'A',
                link(scope, element, attrs) {
                  const type = attrs.mutedType || 'Video';
          Severity: Minor
          Found in src/js/directives.js - About 1 hr to fix

            Function link has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  link(scope, element, attrs) {
                    const type = attrs.mutedType || 'Video';
                    scope[`muted${type}`] = false;
            
                    const getPublisher = () =>
            Severity: Minor
            Found in src/js/directives.js - About 1 hr to fix

              Function json has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    json() {
                      const goToRoom = (err, sessionId, pApiKey, pSecret) => {
                        if (err) {
                          console.error('Error getting room: ', err);
                          res.send({
              Severity: Minor
              Found in server/routes.js - About 1 hr to fix

                Function mutePublisher has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                  .directive('mutePublisher', ['OTSession', function mutePublisher(OTSession) {
                    return {
                      restrict: 'A',
                      link(scope, element, attrs) {
                        const type = attrs.mutedType || 'Video';
                Severity: Minor
                Found in src/js/directives.js - About 55 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 filteredPublisher has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  function filteredPublisher(OTSession, $rootScope) {
                    return {
                      restrict: 'E',
                      scope: {
                        props: '&',
                Severity: Minor
                Found in src/js/filtered-publisher.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 MainCtrl has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  .controller('MainCtrl', ['$scope', '$window', function MainCtrl($scope, $window) {
                    $scope.room = '';
                    $scope.roomType = 'normal';
                    $scope.advanced = false;
                    $scope.joinRoom = () => {
                Severity: Minor
                Found in src/js/login/controller.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 restrictFrameRate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  .directive('restrictFramerate', ['OTSession', function restrictFrameRate(OTSession) {
                    return {
                      restrict: 'E',
                      template: '<button class="restrict-framerate-btn" ng-class="' +
                      '{\'ion-ios7-speedometer-outline\': restrictedFrameRate, ' +
                Severity: Minor
                Found in src/js/directives.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 draggable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  function draggable($document, $window) {
                    const getEventProp = (event, prop) => {
                      if (event[prop] === 0) return 0;
                      return event[prop] || (event.touches && event.touches[0][prop]) ||
                      (event.originalEvent && event.originalEvent.touches &&
                Severity: Minor
                Found in src/js/directives.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