Function import
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
public function import( $wikiPages ) {
Method import
has 41 lines of code (exceeds 25 allowed). Consider refactoring.
public function import( $wikiPages ) {
Function updateTemplateCalls
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
private function updateTemplateCalls( $fact, $propTplIndex, $oldTemplateCalls, $wikiText ) {
$prop = $fact['p'];
$newVal = $fact['o'];
if ( array_key_exists( $prop, $propTplIndex ) ) {
Function buildPropertyTemplateParamIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
private function buildPropertyTemplateParamIndex( $newFacts, $allTemplateFacts ) {
$propTplIndex = array();
foreach ( $newFacts as $fact ) {
$prop = $fact['p'];
The method import() has 111 lines of code. Current threshold is set to 100. Avoid really long methods.
public function import( $wikiPages ) {
The method import() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
public function import( $wikiPages ) {
Missing class import via use statement (line '22', column '15').
throw new MWException( 'Could not import page: Title is empty!' );
The method updateTemplateCalls uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$newTplCallText = str_replace('}}', '|' . $paramName . '=' . $newVal . "\n}}", $oldTplCallText);
}
Avoid using static access to class 'WikiPage' in method 'getTextForPage'.
$pageObj = WikiPage::factory( $titleObj );
Avoid using static access to class 'ContentHandler' in method 'writeToPage'.
$mwArticleObj->doEditContent( ContentHandler::makeContent( $content, $mwTitleObj), $summary );
Avoid using static access to class 'Title' in method 'getTextForPage'.
$titleObj = Title::newFromText( $title, $wikiNamespace );
Avoid using static access to class 'Title' in method 'getWikifiedTitle'.
$titleObj = Title::newFromText( $title, $wikiNamespace );
Avoid using static access to class 'Title' in method 'writeToPage'.
$mwTitleObj = Title::newFromText( $wikiTitle );
Avoid using static access to class 'WikiPage' in method 'writeToPage'.
$mwArticleObj = WikiPage::factory( $mwTitleObj );
There are no issues that match your filters.