wikimedia/mediawiki-extensions-Flow

View on GitHub
handlebars/compiled/flow_block_topic.handlebars.php

Summary

Maintainability
F
1 mo
Test Coverage

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'flow_topic_titlebar_content' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.'<div class="flow-topic-titlebar-container">
'.$sp.'    <h2 class="flow-topic-title flow-load-interactive '.((LR::ifvar($cx, (($inary && isset($in['isLocked'])) ? $in['isLocked'] : null), false)) ? 'flow-collapse-toggle flow-click-interactive' : '').'"
'.$sp.'        data-flow-topic-title="'.LR::encq($cx, ((isset($in['content']) && is_array($in['content']) && isset($in['content']['content'])) ? $in['content']['content'] : null)).'"
'.$sp.'        data-flow-load-handler="topicTitle"
'.$sp.''.((LR::ifvar($cx, (($inary && isset($in['isLocked'])) ? $in['isLocked'] : null), false)) ? '        data-flow-interactive-handler="collapserCollapsibleToggle"
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 1 other location - About 1 wk to fix
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 70..98

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 1781.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'flow_topic' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.'<div class="flow-topic flow-load-interactive'.((LR::ifvar($cx, (($inary && isset($in['moderateState'])) ? $in['moderateState'] : null), false)) ? ' flow-topic-moderatestate-'.LR::encq($cx, (($inary && isset($in['moderateState'])) ? $in['moderateState'] : null)).' ' : '').''.((LR::ifvar($cx, (($inary && isset($in['isModerated'])) ? $in['isModerated'] : null), false)) ? ' flow-topic-moderated ' : '').''.((LR::ifvar($cx, (($inary && isset($in['isLocked'])) ? $in['isLocked'] : null), false)) ? 'flow-element-collapsible flow-element-collapsed' : '').'"
'.$sp.'     id="flow-topic-'.LR::encq($cx, (($inary && isset($in['postId'])) ? $in['postId'] : null)).'"
'.$sp.'     data-flow-id="'.LR::encq($cx, (($inary && isset($in['postId'])) ? $in['postId'] : null)).'"
'.$sp.'     data-flow-load-handler="topic"
'.$sp.'     data-flow-toc-scroll-target=".flow-topic-titlebar"
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 1 other location - About 1 wk to fix
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 212..228

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 1692.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

'flow_reply_form' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.''.((!LR::ifvar($cx, ((isset($in['actions']) && is_array($in['actions']) && isset($in['actions']['unlock'])) ? $in['actions']['unlock'] : null), false)) ? '
'.$sp.'<form class="flow-post flow-reply-form"
'.$sp.'      method="POST"
'.$sp.'      action="'.LR::encq($cx, ((isset($in['actions']['reply']) && is_array($in['actions']['reply']) && isset($in['actions']['reply']['url'])) ? $in['actions']['reply']['url'] : null)).'"
'.$sp.'      id="flow-reply-'.LR::encq($cx, (($inary && isset($in['postId'])) ? $in['postId'] : null)).'"
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 4 other locations - About 1 wk to fix
handlebars/compiled/flow_block_topic_moderate_post.handlebars.php on lines 178..206
handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php on lines 178..206
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 183..211
handlebars/compiled/flow_post.handlebars.php on lines 155..183

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 1314.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'flow_topic_titlebar_summary' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.'<div class="flow-topic-summary-container '.((LR::ifvar($cx, (($inary && isset($in['isLocked'])) ? $in['isLocked'] : null), false)) ? 'flow-collapse-toggle flow-click-interactive' : '').'"
'.$sp.''.((LR::ifvar($cx, (($inary && isset($in['isLocked'])) ? $in['isLocked'] : null), false)) ? '        data-flow-interactive-handler="collapserCollapsibleToggle"
'.$sp.'' : '').'        >
'.$sp.''.LR::p($cx, 'flow_errors', array(array($in),array()),0, '    ').''.((LR::ifvar($cx, ((isset($in['revision']['content']) && is_array($in['revision']['content']) && isset($in['revision']['content']['content'])) ? $in['revision']['content']['content'] : null), false)) ? '        <div class="flow-topic-summary">
'.$sp.'            <div class="flow-topic-summary-author">
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 1 other location - About 1 wk to fix
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 99..114

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 1286.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'flow_topic_titlebar_watch' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.'<div class="flow-topic-watchlist flow-watch-link">
'.$sp.''.LR::p($cx, 'flow_errors', array(array($in),array()),0, '    ').'
'.$sp.'    <a href="'.((LR::ifvar($cx, (($inary && isset($in['isWatched'])) ? $in['isWatched'] : null), false)) ? ''.LR::encq($cx, ((isset($in['links']['unwatch-topic']) && is_array($in['links']['unwatch-topic']) && isset($in['links']['unwatch-topic']['url'])) ? $in['links']['unwatch-topic']['url'] : null)).'' : ''.LR::encq($cx, ((isset($in['links']['watch-topic']) && is_array($in['links']['watch-topic']) && isset($in['links']['watch-topic']['url'])) ? $in['links']['watch-topic']['url'] : null)).'').'"
'.$sp.'       class="mw-ui-anchor mw-ui-hovericon '.((!LR::ifvar($cx, (($inary && isset($in['isWatched'])) ? $in['isWatched'] : null), false)) ? 'mw-ui-quiet' : '').'
'.$sp.''.((LR::ifvar($cx, (($inary && isset($in['isWatched'])) ? $in['isWatched'] : null), false)) ? 'flow-watch-link-unwatch' : 'flow-watch-link-watch').'"
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 1 other location - About 4 days to fix
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 115..124

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 744.

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

Further Reading

Identical blocks of code found in 6 locations. Consider refactoring.
Open

'flow_anon_warning' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.'<div class="flow-anon-warning">
'.$sp.'    <div class="flow-anon-warning-mobile">
'.$sp.''.LR::hbbch($cx, 'tooltip', array(array(),array('positionClass'=>'down','contextClass'=>'progressive','extraClass'=>'flow-form-collapsible','isBlock'=>true)), $in, false, function($cx, $in)use($sp){$inary=is_array($in);return ''.LR::encq($cx, LR::hbch($cx, 'l10nParse', array(array('flow-anon-warning',LR::hbch($cx, 'linkWithReturnTo', array(array('Special:UserLogin'),array()), 'raw', $in),LR::hbch($cx, 'linkWithReturnTo', array(array('Special:UserLogin/signup'),array()), 'raw', $in)),array()), 'encq', $in)).'';}).'    </div>
'.$sp.'
'.$sp.''.LR::hbbch($cx, 'progressiveEnhancement', array(array(),array()), $in, false, function($cx, $in)use($sp){$inary=is_array($in);return '        <div class="flow-anon-warning-desktop">
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 5 other locations - About 3 days to fix
handlebars/compiled/flow_block_topic_moderate_post.handlebars.php on lines 153..160
handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php on lines 153..160
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 31..38
handlebars/compiled/flow_block_topiclist_newtopic.handlebars.php on lines 19..26
handlebars/compiled/flow_post.handlebars.php on lines 130..137

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 596.

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

Further Reading

Identical blocks of code found in 5 locations. Consider refactoring.
Open

'flow_post_moderation_state' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.'<span class="plainlinks">'.((LR::ifvar($cx, (($inary && isset($in['replyToId'])) ? $in['replyToId'] : null), false)) ? ''.LR::encq($cx, LR::hbch($cx, 'l10nParse', array(array(LR::hbch($cx, 'concat', array(array('flow-',(($inary && isset($in['moderateState'])) ? $in['moderateState'] : null),'-post-content'),array()), 'raw', $in),((isset($in['moderator']) && is_array($in['moderator']) && isset($in['moderator']['name'])) ? $in['moderator']['name'] : null),((isset($in['links']['topic-history']) && is_array($in['links']['topic-history']) && isset($in['links']['topic-history']['url'])) ? $in['links']['topic-history']['url'] : null)),array()), 'encq', $in)).'' : ''.LR::encq($cx, LR::hbch($cx, 'l10nParse', array(array(LR::hbch($cx, 'concat', array(array('flow-',(($inary && isset($in['moderateState'])) ? $in['moderateState'] : null),'-title-content'),array()), 'raw', $in),((isset($in['moderator']) && is_array($in['moderator']) && isset($in['moderator']['name'])) ? $in['moderator']['name'] : null),((isset($in['links']['topic-history']) && is_array($in['links']['topic-history']) && isset($in['links']['topic-history']['url'])) ? $in['links']['topic-history']['url'] : null)),array()), 'encq', $in)).'').'</span>
';},
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 4 other locations - About 2 days to fix
handlebars/compiled/flow_block_topic_moderate_post.handlebars.php on lines 62..63
handlebars/compiled/flow_block_topic_moderate_topic.handlebars.php on lines 62..63
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 68..69
handlebars/compiled/flow_post.handlebars.php on lines 39..40

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 569.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'flow_topic_titlebar' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.'<div class="flow-topic-titlebar">
'.$sp.''.LR::p($cx, 'flow_topic_titlebar_content', array(array($in),array()),0, '    ').''.LR::p($cx, 'flow_topic_titlebar_summary', array(array((($inary && isset($in['summary'])) ? $in['summary'] : null)),array('isLocked'=>(($inary && isset($in['isLocked'])) ? $in['isLocked'] : null))),0, '    ').''.((LR::ifvar($cx, (($inary && isset($in['watchable'])) ? $in['watchable'] : null), false)) ? ''.LR::p($cx, 'flow_topic_titlebar_watch', array(array($in),array()),0, '        ').'' : '').'    <div class="flow-menu flow-menu-hoverable">
'.$sp.'        <div class="flow-menu-js-drop"><a href="javascript:void(0);"><span class="mw-ui-icon mw-ui-icon-before mw-ui-icon-only mw-ui-icon-ellipsis" aria-label="'.LR::encq($cx, LR::hbch($cx, 'l10n', array(array('flow-topic-action-menu-accessibility-name'),array()), 'encq', $in)).'"></span></a></div>
'.$sp.'        <ul class="mw-ui-button-container flow-list">
'.$sp.''.LR::p($cx, 'flow_moderation_actions_list', array(array($in),array('moderationType'=>'topic','moderationTarget'=>'title','moderationTemplate'=>'topic','moderationContainerClass'=>'flow-menu','moderationMwUiClass'=>'mw-ui-button','moderationIcons'=>true)),0, '            ').'        </ul>
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 1 other location - About 2 days to fix
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 175..182

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 436.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'flow_topic_moderation_flag' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.'<span class="mw-ui-icon mw-ui-icon-before'.LR::hbbch($cx, 'ifCond', array(array((($inary && isset($in['moderateState'])) ? $in['moderateState'] : null),'===','lock'),array()), $in, false, function($cx, $in)use($sp){$inary=is_array($in);return ' mw-ui-icon-check';}).''.LR::hbbch($cx, 'ifCond', array(array((($inary && isset($in['moderateState'])) ? $in['moderateState'] : null),'===','hide'),array()), $in, false, function($cx, $in)use($sp){$inary=is_array($in);return ' mw-ui-icon-flag';}).''.LR::hbbch($cx, 'ifCond', array(array((($inary && isset($in['moderateState'])) ? $in['moderateState'] : null),'===','delete'),array()), $in, false, function($cx, $in)use($sp){$inary=is_array($in);return ' mw-ui-icon-trash';}).'"></span>
';},
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 1 other location - About 1 day to fix
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 66..67

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 364.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

'flow_topiclist_loop' => function ($cx, $in, $sp) {$inary=is_array($in);return ''.$sp.''.LR::sec($cx, (($inary && isset($in['roots'])) ? $in['roots'] : null), null, $in, true, function($cx, $in)use($sp){$inary=is_array($in);return ''.LR::hbbch($cx, 'eachPost', array(array((isset($cx['sp_vars']['root']) ? $cx['sp_vars']['root'] : null),$in),array()), $in, false, function($cx, $in)use($sp){$inary=is_array($in);return ''.LR::p($cx, 'flow_topic', array(array($in),array()),0, '        ').'';}).'';}).'';});
Severity: Major
Found in handlebars/compiled/flow_block_topic.handlebars.php and 1 other location - About 1 day to fix
handlebars/compiled/flow_block_topiclist.handlebars.php on lines 229..229

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 283.

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

Further Reading

There are no issues that match your filters.

Category
Status