Showing 1,238 of 1,238 total issues
Function getLookupRequest
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
EntitySelectorWidget.prototype.getLookupRequest = function () {
var value = this.getValue();
var widget = this;
if ( !this.allowSuggestionsWhenEmpty && value === '' ) {
Function displayOnMultipleSelection
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayOnMultipleSelection() {
var selectedUserIDs = $( '.request-selector:checked' ).map( function ( i, checkedBox ) {
return $( checkedBox ).parents( 'div.request' ).data( 'data' ).userid;
} ).toArray();
Function rgb
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
convert.hsl.rgb = function (hsl) {
var h = hsl[0] / 360;
var s = hsl[1] / 100;
var l = hsl[2] / 100;
var t1;
Function Color
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Color = function (obj) {
if (obj instanceof Color) {
return obj;
}
if (!(this instanceof Color)) {
Method doCreate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doCreate(): void {
$params = $this->extractRequestParams();
// Do validations
foreach ( explode( '|', 'username|password|email' ) as $field ) {
Method processGroups
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processGroups( array $groups ): array {
$fixedGroups = [];
foreach ( $groups as $g ) {
$name = $g['name'];
Method tuxLanguageSelector
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function tuxLanguageSelector(): string {
if ( $this->options['language'] === $this->getConfig()->get( 'TranslateDocumentationLanguageCode' ) ) {
$targetLangName = $this->msg( 'translate-documentation-language' )->text();
$targetLanguage = $this->contentLanguage;
} else {
Method makeGroupFacetRows
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function makeGroupFacetRows(
array $groups,
array $counts,
int $level = 0,
string $pathString = ''
Method execute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$name = $this->getOption( 'name', MessageChangeStorage::DEFAULT_NAME );
if ( !MessageChangeStorage::isValidCdbName( $name ) ) {
$this->fatalError( 'Invalid name' );
}
Method unflatten
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function unflatten( array $flat ): array {
$unflat = [];
if ( $this->parseCLDRPlurals ) {
$unflattenedPlurals = [];
Method getIssues
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIssues( Message $message, string $targetLanguage ): ValidationIssues {
$issues = new ValidationIssues();
// We skip certain validations if we don't know the expected keywords
$expectedKeywords = UnicodePlural::getPluralKeywords( $targetLanguage );
Similar blocks of code found in 2 locations. Consider refactoring. Open
$( '<div>' )
.text( '↑' )
.addClass( 'shortcut-popup' )
.appendTo( document.body )
.offset( { top: middle - 15, left: maxLeft } )
- 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 66.
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
$( '<div>' )
.text( '↓' )
.addClass( 'shortcut-popup' )
.appendTo( document.body )
.offset( { top: middle + 15, left: maxLeft } )
- 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 66.
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
text = text.replace( /\[\[(.+?)\]\]/g, function ( match, p1 ) {
var $link = $( '<a>' ).html( p1 ).prop( 'href', mw.util.getUrl( p1 ) );
return $( '<div>' ).append( $link ).html();
} );
- 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 66.
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
text = text.replace( /\[\[([^\]|]+?)\|(.+?)\]\]/g, function ( match, p1, p2 ) {
var $link = $( '<a>' ).html( p2 ).prop( 'href', mw.util.getUrl( p1 ) );
return $( '<div>' ).append( $link ).html();
} );
- 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 66.
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 setValues
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Color.prototype.setValues = function (space, vals) {
var values = this.values;
var spaces = this.spaces;
var maxes = this.maxes;
var alpha = 1;
Function requestSelectHandler
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function requestSelectHandler( e ) {
var request = e.target,
$detailsPane = $( '.details.pane' ),
$requestCheckboxes = $( '.request-selector' ),
$selectAll = $( '.request-selector-all' ),
Function hsv
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
convert.rgb.hsv = function (rgb) {
var rdif;
var gdif;
var bdif;
var h;
Function associate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function associate( event, subGroupId ) {
var $target = $( event.target ),
$parent = $target.parents( '.mw-tpa-group' ),
parentId = $parent.data( 'id' ),
subgroupName = $parent
Function fitWithPointLabels
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function fitWithPointLabels(scale) {
// Right, this is really confusing and there is a lot of maths going on here
// The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9
//