File ApiQueryRevisionsBase.php
has 703 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
Function extractDeprecatedContent
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
private function extractDeprecatedContent( Content $content, RevisionRecord $revision ) {
$vals = [];
$title = Title::newFromLinkTarget( $revision->getPageAsLinkTarget() );
if ( $this->fld_parsetree || ( $this->fld_content && $this->generateXML ) ) {
- 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 extractRevisionInfo
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
protected function extractRevisionInfo( RevisionRecord $revision, $row ) {
$vals = [];
$anyHidden = false;
if ( $this->fld_ids ) {
- 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 parseParameters
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
protected function parseParameters( $params ) {
$prop = array_fill_keys( $params['prop'], true );
$this->fld_ids = isset( $prop['ids'] );
$this->fld_flags = isset( $prop['flags'] );
- 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 extractDeprecatedContent
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractDeprecatedContent( Content $content, RevisionRecord $revision ) {
$vals = [];
$title = Title::newFromLinkTarget( $revision->getPageAsLinkTarget() );
if ( $this->fld_parsetree || ( $this->fld_content && $this->generateXML ) ) {
Method parseParameters
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseParameters( $params ) {
$prop = array_fill_keys( $params['prop'], true );
$this->fld_ids = isset( $prop['ids'] );
$this->fld_flags = isset( $prop['flags'] );
Method extractRevisionInfo
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function extractRevisionInfo( RevisionRecord $revision, $row ) {
$vals = [];
$anyHidden = false;
if ( $this->fld_ids ) {
Method getAllowedParams
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllowedParams() {
$slotRoles = $this->slotRoleRegistry->getKnownRoles();
sort( $slotRoles, SORT_STRING );
$smallLimit = $this->getMain()->canApiHighLimits() ? ApiBase::LIMIT_SML2 : ApiBase::LIMIT_SML1;
Function extractSlotInfo
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
private function extractSlotInfo( SlotRecord $slot, $revDel, &$content = null ) {
$vals = [];
ApiResult::setArrayType( $vals, 'assoc' );
if ( $this->fld_slotsize ) {
- 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 extractAllSlotInfo
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private function extractAllSlotInfo( RevisionRecord $revision, $revDel ): array {
$vals = [];
if ( $this->slotRoles === null ) {
try {
- 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 extractAllSlotInfo
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractAllSlotInfo( RevisionRecord $revision, $revDel ): array {
$vals = [];
if ( $this->slotRoles === null ) {
try {
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiQuery $queryModule,
$moduleName,
$paramPrefix = '',
RevisionStore $revisionStore = null,
IContentHandlerFactory $contentHandlerFactory = null,
Method extractSlotInfo
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extractSlotInfo( SlotRecord $slot, $revDel, &$content = null ) {
$vals = [];
ApiResult::setArrayType( $vals, 'assoc' );
if ( $this->fld_slotsize ) {