Showing 167 of 167 total issues
Function _initializeCastApi
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
_initializeCastApi: function() {
var self = this;
self.player.trigger("cast-available", true);
var googleCastInitialOptions = this.googleCast.initialOptions;
Function _enhanceSDP
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
_enhanceSDP: function(sdpStr, enhanceData) {
var sdpLines = sdpStr.split(/\r\n/);
var sdpSection = 'header';
var hitMID = false;
var sdpStrRet = '';
Function _setup
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setup: function() {
this._loaded = false;
this._domEvents.on(this._element, "canplay", this._eventLoaded, this);
this._domEvents.on(this._element, "loadedmetadata", this._eventLoadedMetaData, this);
this._domEvents.on(this._element, "playing", this._eventPlaying, this);
Function _drawTracksToCanvas
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawTracksToCanvas: function() {
if (!this._drawingStream)
return;
var videosCount = this._videoElements.length;
var reversed = false;
Function _setupCastRemotePlayer
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
_setupCastRemotePlayer: function(castRemotePlayer, castRemotePlayerController) {
var self = this;
var player = this.player;
var options = this.castOptions;
var sources = player._sources;
Function _detectCurrentDeviceId
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
_detectCurrentDeviceId: function(devices, devicesCount, isVideo) {
var _currentDeviceTrack, _currentDeviceSettings, _counter;
if (isVideo) {
_currentDeviceTrack = this._recorder._videoTrack;
_currentDeviceSettings = this._recorder._videoTrackSettings;
Function _arraySingleVideoElement
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
_arraySingleVideoElement: function(options, stream, additionalStream, videoTrack) {
var self = this;
var video = Support.bindStreamToVideo(stream);
additionalStream = additionalStream || false;
if (additionalStream) {
Function bindMedia
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindMedia: function() {
if (this._bound)
return;
return Support.userMedia2(this._getConstraints()).success(function(stream) {
if (!this._options) return;
Function _startPlayback
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
_startPlayback: function(options, elementCallback) {
var playResult, timeoutId, sendOutput;
var muted = options.muted,
timeout = options.timeout,
playsinline = options.playsinline;
Function isBlankFrame
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
isBlankFrame: function(canvas, frame, _pixTolerance, _frameTolerance) {
if (typeof Array.prototype.some === "function") {
return !canvas.getContext('2d')
.getImageData(0, 0, canvas.width, canvas.height).data
.some(function(channel) {
Function constructor
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor: function(options, transitionals) {
inherited.constructor.call(this);
options = Objs.extend(Objs.clone(options || {}, 1), transitionals);
var sources = options.source || options.sources || [];
if (Types.is_string(sources))
Similar blocks of code found in 2 locations. Consider refactoring. Open
this._whammyRecorder.on("data", function(blob) {
this._videoBlob = blob;
if (this._audioBlob || !this._hasAudio)
this._dataAvailable(this._videoBlob, this._audioBlob);
}, this);
- Read upRead up
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 71.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
this._audioRecorder.on("data", function(blob) {
this._audioBlob = blob;
if (this._videoBlob || !this._hasVideo)
this._dataAvailable(this._videoBlob, this._audioBlob);
}, this);
- Read upRead up
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 71.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function _loadHls
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
_loadHls: function(source) {
var promise = Promise.create();
var Hls = this._hlsObj();
this._hls = new Hls();
this._hls.on(Hls.Events.MEDIA_ATTACHED, function() {
Function enumerateMediaSources
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
enumerateMediaSources: function() {
var promise = Promise.create();
var promiseCallback = function(sources) {
var result = {
audio: {},
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (options.video.width) {
opts.video.mandatory.minWidth = options.video.width;
opts.video.mandatory.maxWidth = options.video.width;
}
- Read upRead up
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 69.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (options.video.frameRate) {
opts.video.mandatory.minFrameRate = options.video.frameRate;
opts.video.mandatory.maxFrameRate = options.video.frameRate;
}
- Read upRead up
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 69.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function __checkAndApplyCorrectConstraints
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
__checkAndApplyCorrectConstraints: function(videoTrack, capabilities, setConstraints) {
var maxWidth = capabilities.width.max;
var maxHeight = capabilities.height.max;
if (setConstraints.width > maxWidth || setConstraints.height > maxHeight) {
Function errorHandler
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
errorHandler: function(err) {
switch (err) {
case 'NotReadableError':
case 'TrackStartError':
return {
Similar blocks of code found in 3 locations. Consider refactoring. Open
selectMicrophone: function(microphoneId) {
this._options.audioId = microphoneId;
if (this._bound) {
this.unbindMedia();
this.bindMedia();
- Read upRead up
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 68.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76