aullman/opentok-meet

View on GitHub

Showing 40 of 40 total issues

Function RoomCtrl has 235 lines of code (exceeds 25 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: Major
Found in src/js/controllers.js - About 1 day to fix

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

    module.exports = (app, config, redis, ot) => {
      const RoomStore = roomstore(redis, ot);
    
      // Keeping this around for legacy URLs. The new URL format for
      // archives is /:room/archive/:archiveId though
    Severity: Major
    Found in plugins/archiving/index.js - About 4 hrs to fix

      Function filteredPublisher has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function filteredPublisher(OTSession, $rootScope) {
          return {
            restrict: 'E',
            scope: {
              props: '&',
      Severity: Major
      Found in src/js/filtered-publisher.js - About 3 hrs to fix

        Function PublisherStatsDirective has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function PublisherStatsDirective(OTSession, $interval) {
          function link(scope) {
            let currentPublisher;
            const allLastStats = {};
            let currentInterval;
        Severity: Major
        Found in src/js/publisher-stats.js - About 3 hrs to fix

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

              document.addEventListener('click', (event) => {
                // If they click anywhere outside the picker then hide the list
                if (element.find(event.target).length === 0 &&
                  element.find('ul').find(event.target).length === 0) {
                  scope.showFilterList = false;
          Severity: Major
          Found in src/js/filter-picker.js and 1 other location - About 3 hrs to fix
          src/js/microphone-picker.js on lines 36..43

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

          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

              document.addEventListener('click', (event) => {
                // If they click anywhere outside the picker then hide the list
                if (element.find(event.target).length === 0
                  && element.find('ul').find(event.target).length === 0) {
                  scope.showDeviceList = false;
          Severity: Major
          Found in src/js/microphone-picker.js and 1 other location - About 3 hrs to fix
          src/js/filter-picker.js on lines 58..65

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

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

                link(scope, element, attrs) {
                  const props = angular.copy(scope.props() || {});
          
                  props.mirror = true;
                  props.resolution = '640x480';
          Severity: Major
          Found in src/js/filtered-publisher.js - About 3 hrs to fix

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

              function link(scope) {
                let currentPublisher;
                const allLastStats = {};
                let currentInterval;
            
            
            Severity: Major
            Found in src/js/publisher-stats.js - About 3 hrs to fix

              Function StatsService has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function StatsService($interval) {
                  let interval;
                  const subscribers = {}; // A collection of SubscriberStats objects keyed by subscriber.id
                  const updateStats = () => {
                    Object.keys(subscribers).forEach((subscriberId) => {
              Severity: Major
              Found in src/js/subscriber-stats.js - About 2 hrs to fix

                Function draggable has 69 lines of code (exceeds 25 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: Major
                Found in src/js/directives.js - About 2 hrs to fix

                  Function FilterPickerDirective has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function FilterPickerDirective() {
                    function link(scope, element) {
                      let currentPublisher;
                      scope.showFilterList = false;
                      scope.filters = ['none', 'brannan', 'xpro2', 'moon', 'nashville', 'lofi', 'helena', '1977'];
                  Severity: Major
                  Found in src/js/filter-picker.js - About 2 hrs to fix

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

                    module.exports = (redis, ot) => {
                      const roomStore = {
                        isP2P(room) {
                          return room.toLowerCase().indexOf('p2p') >= 0;
                        },
                    Severity: Major
                    Found in server/roomstore.js - About 2 hrs to fix

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

                      module.exports = (app, config, redis, ot, redirectSSL) => {
                        const RoomStore = roomstore(redis, ot);
                        app.get('*', (req, res, next) => {
                          if (req.host === 'hangout.tokbox.com') {
                            res.redirect(`https://meet.tokbox.com${req.url}`);
                      Severity: Major
                      Found in server/routes.js - About 2 hrs to fix

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

                          controller: ['$scope', 'chromeExtensionId', function controller($scope, chromeExtensionId) {
                            $scope.promptToInstall = false;
                            $scope.selectingScreenSource = false;
                            $scope.sharingMyScreen = false;
                            $scope.screenShareSupported = true;
                        Severity: Major
                        Found in src/js/screen/directive.js - About 2 hrs to fix

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

                            function link(scope, element) {
                              let currentPublisher;
                              scope.showFilterList = false;
                              scope.filters = ['none', 'brannan', 'xpro2', 'moon', 'nashville', 'lofi', 'helena', '1977'];
                              scope.filterImages = null;
                          Severity: Major
                          Found in src/js/filter-picker.js - About 2 hrs to fix

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

                                function updateStats() {
                                  const hasPublisher = currentPublisher != null;
                                  const hasGetStats = currentPublisher && typeof currentPublisher.getStats === 'function';
                            
                                  if (!hasPublisher || !hasGetStats) {
                            Severity: Major
                            Found in src/js/publisher-stats.js - About 2 hrs to fix

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

                                  getRoom(room, apiKey, secret) {
                                    console.log(`getRoom: ${room} ${apiKey} ${secret}`);
                                    const goToRoom = arguments[arguments.length - 1]; // eslint-disable-line
                                    // Lookup the mapping of rooms to sessionIds
                                    redis.hget('rooms', room, (err, sid) => {
                              Severity: Major
                              Found in server/roomstore.js - About 2 hrs to fix

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

                                      const whiteboardUpdated = () => {
                                        if (!$scope.showWhiteboard && !$scope.whiteboardUnread) {
                                        // Someone did something to the whiteboard while we weren't looking
                                          $scope.$apply(() => {
                                            $scope.whiteboardUnread = true;
                                Severity: Major
                                Found in src/js/controllers.js and 1 other location - About 2 hrs to fix
                                src/js/controllers.js on lines 182..190

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

                                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

                                      const editorUpdated = () => {
                                        if (!$scope.showEditor && !$scope.editorUnread) {
                                        // Someone did something to the editor while we weren't looking
                                          $scope.$apply(() => {
                                            $scope.editorUnread = true;
                                Severity: Major
                                Found in src/js/controllers.js and 1 other location - About 2 hrs to fix
                                src/js/controllers.js on lines 173..181

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

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

                                function MicrophonePickerDirective() {
                                  function link(scope, element) {
                                    let currentPublisher;
                                    scope.devices = [];
                                    scope.showDeviceList = false;
                                Severity: Major
                                Found in src/js/microphone-picker.js - About 2 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language