aullman/opentok-meet

View on GitHub

Showing 34 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

          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

                                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

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

                                      const updateStats = () => {
                                        Object.keys(subscribers).forEach((subscriberId) => {
                                          const subscriberStats = subscribers[subscriberId];
                                          const { subscriber, lastStats, lastLastStats } = subscriberStats;
                                          subscriber.getStats((err, stats) => {
                                  Severity: Minor
                                  Found in src/js/subscriber-stats.js - About 1 hr to fix

                                    Function NotificationService has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      function NotificationService($window, OTSession, Push) {
                                        let focused = true;
                                    
                                        $window.addEventListener('blur', () => {
                                          focused = false;
                                    Severity: Minor
                                    Found in src/js/notifications.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 PublisherStatsDirective has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function PublisherStatsDirective(OTSession, $interval) {
                                      function link(scope) {
                                        let currentPublisher;
                                        const allLastStats = {};
                                        let currentInterval;
                                    Severity: Minor
                                    Found in src/js/publisher-stats.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 NotificationService has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function NotificationService($window, OTSession, Push) {
                                        let focused = true;
                                    
                                        $window.addEventListener('blur', () => {
                                          focused = false;
                                    Severity: Minor
                                    Found in src/js/notifications.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language