Showing 538 of 538 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
try {
var viewerOrigin = new URL(window.location.href).origin || 'null';
if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) {
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 75.
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
try {
var viewerOrigin = new URL(window.location.href).origin || 'null';
if (HOSTED_VIEWER_ORIGINS.indexOf(viewerOrigin) >= 0) {
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 75.
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 isValidExplicitDestination
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isValidExplicitDestination(dest) {
if (!(dest instanceof Array)) {
return false;
}
var destLength = dest.length,
Function isValidExplicitDestination
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function isValidExplicitDestination(dest) {
if (!(dest instanceof Array)) {
return false;
}
var destLength = dest.length,
Function draw
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function draw() {
var _this2 = this;
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
console.error('Must be in new state before drawing');
Function error
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
error: function error(message, moreInfo) {
var moreInfoText = [this.l10n.get('error_version_info', {
version: _pdfjsLib.version || '?',
build: _pdfjsLib.build || '?'
}, 'PDF.js v{{version}} (build: {{build}})')];
Function error
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
error: function error(message, moreInfo) {
var moreInfoText = [this.l10n.get('error_version_info', {
version: _pdfjsLib.version || '?',
build: _pdfjsLib.build || '?'
}, 'PDF.js v{{version}} (build: {{build}})')];
Function draw
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function draw() {
var _this2 = this;
if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
console.error('Must be in new state before drawing');
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function render(_ref2) {
var outline = _ref2.outline;
var outlineCount = 0;
if (this.outline) {
Function render
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function render(_ref2) {
var outline = _ref2.outline;
var outlineCount = 0;
if (this.outline) {
Function nextMatch
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function nextMatch() {
var _this4 = this;
var previous = this.state.findPrevious;
var currentPageIndex = this.pdfViewer.currentPageNumber - 1;
Function nextMatch
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function nextMatch() {
var _this4 = this;
var previous = this.state.findPrevious;
var currentPageIndex = this.pdfViewer.currentPageNumber - 1;
Function pdfHistoryPush
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
push: function pdfHistoryPush(params, isInitialBookmark) {
if (!(this.initialized && this.historyUnlocked)) {
return;
}
if (params.dest && !params.hash) {
Function pdfHistoryPush
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
push: function pdfHistoryPush(params, isInitialBookmark) {
if (!(this.initialized && this.historyUnlocked)) {
return;
}
if (params.dest && !params.hash) {
Function update
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function update(scale, rotation) {
this.scale = scale || this.scale;
if (typeof rotation !== 'undefined') {
this.rotation = rotation;
}
Function willStart
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
willStart: function () {
var self = this;
var re = /(?:\.([^.]+))?$/;
var parts = re.exec(this.file.name);
var name_without_ext = this.file.name.slice(0, -parts[1].length - 1);
Function _touchSwipe
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function _touchSwipe(evt) {
if (!this.active) {
return;
}
if (evt.touches.length > 1) {
Function _touchSwipe
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function _touchSwipe(evt) {
if (!this.active) {
return;
}
if (evt.touches.length > 1) {
Function update
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
value: function update(scale, rotation) {
this.scale = scale || this.scale;
if (typeof rotation !== 'undefined') {
this.rotation = rotation;
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
session.getLastResult = function (options) {
options = _fill(options);
options.cmisaction = 'lastResult';
return new CmisRequest(_post(session.defaultRepository.repositoryUrl)
.send(options));
- 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 70.
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