Showing 681 of 907 total issues
File TemplateHelper.php
has 469 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Flow;
use Closure;
Method buildActions
has 165 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildActions( FormatterRow $row ) {
global $wgThanksSendToBots;
$user = $this->permissions->getUser();
$workflow = $row->workflow;
Function execute
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $wgLang;
$this->dbFactory = Container::get( 'db.factory' );
$this->workflowLoaderFactory = Container::get( 'factory.loader.workflow' );
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function execute
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
// Reflection hackery: make setContentRaw() callable
$this->setContentRawMethod = new ReflectionMethod( AbstractRevision::class, 'setContentRaw' );
$this->setContentRawMethod->setAccessible( true );
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File OptInController.php
has 423 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Flow\Import;
use DateTime;
Function __module10__
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __module10__ = (function(__dependency1__) {
"use strict";
var __exports__;
var Visitor = __dependency1__;
UrlGenerator
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class UrlGenerator {
/**
* @var CachingObjectMapper
*/
private $workflowMapper;
File flow-component-events.js
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* Contains the code which registers and handles event callbacks.
* In addition, it contains some common callbacks (eg. apiRequest)
* @todo Find better places for a lot of the callbacks that have been placed here
*/
Method formatApi
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatApi( FormatterRow $row, IContextSource $ctx, $action = 'view' ) {
$this->permissions->setUser( $ctx->getUser() );
if ( !$this->permissions->isAllowed( $row->revision, $action ) ) {
LoggerFactory::getInstance( 'Flow' )->debug(
File mw.flow.ui.EditorWidget.js
has 398 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* global ve */
( function () {
/**
* Flow editor widget
*
Function mwUiTooltipShow
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mwUiTooltipShow( target, content, options ) {
var $target = $( target ),
// Find previous tooltip for this el
$tooltip = $target.data( '$tooltip' ),
Function anonymous
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var $0 = $$.length - 1;
switch (yystate) {
case 1: return $$[$0-1];
Function __module15__
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
var __module15__ = (function(__dependency1__) {
"use strict";
var __exports__;
var isArray = __dependency1__.isArray;
Function buildLinks
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
public function buildLinks( FormatterRow $row ) {
$workflow = $row->workflow;
$revision = $row->revision;
$title = $workflow->getArticleTitle();
$action = $revision->getChangeType();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method processParam
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function processParam(
$param,
$revision,
UUID $workflowId,
IContextSource $ctx,
Function template
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
function template(templateSpec, env) {
/* istanbul ignore next */
if (!env) {
throw new Exception("No environment passed to template");
}
Function registerDefaultHelpers
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
function registerDefaultHelpers(instance) {
instance.registerHelper('helperMissing', function(/* [args, ]options */) {
if(arguments.length === 1) {
// A missing field in a {{foo}} constuct.
return undefined;
Function validateOptions
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
protected function validateOptions( $options ) {
static $validUnaryOptions = [
'UNIQUE',
'EXPLAIN',
];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function anonymous
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {
function strip(start, end) {
return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng-end);
Method onNukeGetNewPages
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function onNukeGetNewPages( $username, $pattern, $namespace, $limit, &$pages ) {
if ( $namespace && $namespace !== NS_TOPIC ) {
// not interested in any Topics
return true;
}