Bläddra i källkod

fix(eslint): Add max-depth rule

release-8443
hristoterezov 8 år sedan
förälder
incheckning
f647f03e5d
4 ändrade filer med 13 tillägg och 0 borttagningar
  1. 1
    0
      .eslintrc.js
  2. 2
    0
      modules/RTC/TraceablePeerConnection.js
  3. 9
    0
      modules/xmpp/SDP.js
  4. 1
    0
      modules/xmpp/SdpConsistency.js

+ 1
- 0
.eslintrc.js Visa fil

186
                 'beforeLineComment': true
186
                 'beforeLineComment': true
187
             }
187
             }
188
         ],
188
         ],
189
+        'max-depth': 2,
189
         'max-len': [ 'error', 80 ],
190
         'max-len': [ 'error', 80 ],
190
         'max-lines': 0,
191
         'max-lines': 0,
191
         'max-nested-callbacks': 2,
192
         'max-nested-callbacks': 2,

+ 2
- 0
modules/RTC/TraceablePeerConnection.js Visa fil

491
                     // Note that group.semantics is already present
491
                     // Note that group.semantics is already present
492
 
492
 
493
                     group.ssrcs = groupSSRCs;
493
                     group.ssrcs = groupSSRCs;
494
+
495
+                    // eslint-disable-next-line max-depth
494
                     if (!groupsMap.has(primarySSRC)) {
496
                     if (!groupsMap.has(primarySSRC)) {
495
                         groupsMap.set(primarySSRC, []);
497
                         groupsMap.set(primarySSRC, []);
496
                     }
498
                     }

+ 9
- 0
modules/xmpp/SDP.js Visa fil

241
 
241
 
242
                 if (afmtpline) {
242
                 if (afmtpline) {
243
                     tmp = SDPUtil.parseFmtp(afmtpline);
243
                     tmp = SDPUtil.parseFmtp(afmtpline);
244
+
245
+                    // eslint-disable-next-line max-depth
244
                     for (k = 0; k < tmp.length; k++) {
246
                     for (k = 0; k < tmp.length; k++) {
245
                         elem.c('parameter', tmp[k]).up();
247
                         elem.c('parameter', tmp[k]).up();
246
                     }
248
                     }
317
                     // FIXME what is this ? global APP.RTC in SDP ?
319
                     // FIXME what is this ? global APP.RTC in SDP ?
318
                     const localTrack = APP.RTC.getLocalTracks(mline.media);
320
                     const localTrack = APP.RTC.getLocalTracks(mline.media);
319
 
321
 
322
+                    // eslint-disable-next-line max-depth
320
                     if (localTrack) {
323
                     if (localTrack) {
321
                         // FIXME before this changes the track id was accessed,
324
                         // FIXME before this changes the track id was accessed,
322
                         // but msid stands for the stream id, makes no sense ?
325
                         // but msid stands for the stream id, makes no sense ?
323
                         msid = localTrack.getTrackId();
326
                         msid = localTrack.getTrackId();
324
                     }
327
                     }
328
+
329
+                    // eslint-disable-next-line max-depth
325
                     if (msid !== null) {
330
                     if (msid !== null) {
326
                         msid = SDPUtil.filterSpecialChars(msid);
331
                         msid = SDPUtil.filterSpecialChars(msid);
327
                         elem.c('parameter');
332
                         elem.c('parameter');
375
                         uri: tmp.uri,
380
                         uri: tmp.uri,
376
                         id: tmp.value
381
                         id: tmp.value
377
                     });
382
                     });
383
+
384
+                    // eslint-disable-next-line max-depth
378
                     if (tmp.hasOwnProperty('direction')) {
385
                     if (tmp.hasOwnProperty('direction')) {
386
+
387
+                        // eslint-disable-next-line max-depth
379
                         switch (tmp.direction) {
388
                         switch (tmp.direction) {
380
                         case 'sendonly':
389
                         case 'sendonly':
381
                             elem.attrs({ senders: 'responder' });
390
                             elem.attrs({ senders: 'responder' });

+ 1
- 0
modules/xmpp/SdpConsistency.js Visa fil

103
                         const primarySsrc = parsePrimarySSRC(group);
103
                         const primarySsrc = parsePrimarySSRC(group);
104
                         const rtxSsrc = parseSecondarySSRC(group);
104
                         const rtxSsrc = parseSecondarySSRC(group);
105
 
105
 
106
+                        // eslint-disable-next-line max-depth
106
                         if (primarySsrc === newPrimarySsrc) {
107
                         if (primarySsrc === newPrimarySsrc) {
107
                             group.ssrcs
108
                             group.ssrcs
108
                                 = `${this.cachedPrimarySsrc} ${rtxSsrc}`;
109
                                 = `${this.cachedPrimarySsrc} ${rtxSsrc}`;

Laddar…
Avbryt
Spara