Showing 167 of 167 total issues
Function __compile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
__compile: function(frames) {
var totalDuration = 0;
var width = null;
var height = null;
var clusters = [];
Function addNewSingleStream
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
addNewSingleStream: function(device, options) {
this._initCanvasStreamSettings();
var _options, _positionX, _positionY, _height, _width, _aspectRatio, _constraints;
var _isTrueHeight = true;
_aspectRatio = this._options.video.aspectRatio;
Function promiseCallback
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
var promiseCallback = function(sources) {
var result = {
audio: {},
audioCount: 0,
video: {},
Function exports
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
var pkg = grunt.file.readJSON('package.json');
var gruntHelper = require('betajs-compile');
var dist = 'betajs-media';
Identical blocks of code found in 2 locations. Consider refactoring. Open
this._domEvents.on(this._element, "loadevent", function() {
if ( /*loadevent === "loadstart" && */ this._element.networkState === this._element.NETWORK_NO_SOURCE) {
promise.asyncError(true);
return;
}
- 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 58.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
this._domEvents.on(this._element, loadevent, function() {
if ( /*loadevent === "loadstart" && */ this._element.networkState === this._element.NETWORK_NO_SOURCE) {
promise.asyncError(true);
return;
}
- 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 58.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
else if (_currentDeviceTrack.label) {
_counter = 1;
Objs.iter(devices, function(device, index) {
// If determine label will return device ID
if (Comparators.byValue(device.label, _currentDeviceTrack.label) === 0) {
- 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 58.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (_currentDeviceSettings && _currentDeviceTrack) {
if (_currentDeviceSettings.deviceId && devices[_currentDeviceSettings.deviceId]) {
if (isVideo)
this._currentVideo = devices[_currentDeviceSettings.deviceId].id;
else
- 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 58.
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 createSnapshotFromSource
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
createSnapshotFromSource: function(videoSource, type, time, isUploader, h, w, x, y, quality) {
Function __calculateVideoTrackSettings
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
__calculateVideoTrackSettings: function(sourceVideoSettings, videoElement, setInitialSettings) {
videoElement = videoElement || this._video;
var _lookedWidth, _lookedHeight, _slippedWidth, _slippedHeight, _dimensions;
var _asR = sourceVideoSettings.aspectRatio || (sourceVideoSettings.width / sourceVideoSettings.height);
if (!isNaN(_asR)) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (typeof Blob !== 'undefined' && source.src instanceof Blob)
source.src = (window.URL || window.webkitURL).createObjectURL(source.src);
- 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 57.
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 (typeof Blob !== 'undefined' && source.audiosrc instanceof Blob)
source.audiosrc = (window.URL || window.webkitURL).createObjectURL(source.audiosrc);
- 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 57.
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 _wsOnMessage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
_wsOnMessage: function(evt) {
var data = JSON.parse(evt.data);
var status = parseInt(data.status, 10);
var command = data.command;
if (status !== 200) {
Function createSnapshotFromSource
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
createSnapshotFromSource: function(videoSource, type, time, isUploader, h, w, x, y, quality) {
var promise = Promise.create();
var video = document.createElement("video");
video.src = videoSource;
Function elementFileInfo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
elementFileInfo: function(elementType, elementEvent, elementAttrs, file) {
try {
var element = document.createElement(elementType);
Objs.iter(elementAttrs, function(value, key) {
element[key] = value;
Function waveChannelTransform
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
waveChannelTransform: function(dumpedInputBuffer, volume, schedulable, schedulableCtx) {
var promise = Promise.create();
var volumeFactor = 0x7FFF * (volume || 1);
var offset = dumpedInputBuffer.offset;
var endOffset = dumpedInputBuffer.endOffset;
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor: function(options) {
inherited.constructor.call(this, options);
this._video = options.video;
this._localPlaybackRequested = options.localPlaybackRequested;
this._recording = false;
Function _googleCastPlayerErrorMessages
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
_googleCastPlayerErrorMessages: function(error) {
switch (error.code) {
case chrome.cast.ErrorCode.API_NOT_INITIALIZED:
return 'The API is not initialized.' +
(error.description ? ' :' + error.description : '');
Function bindStreamToVideo
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
bindStreamToVideo: function(stream, video, flip) {
if (!video)
video = document.createElement("video");
video.volume = 0;
video.muted = true;
Function createSnapshot
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
createSnapshot: function(type, video, isUploader, h, w, x, y, quality) {