Showing 51 of 158 total issues
File SpecialSPARQLEndpoint.php
has 390 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class SPARQLEndpoint extends RDFIOSpecialPage {
protected $sparqlendpoint;
protected $storewrapper;
Function toEquivUrisInTriples
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function toEquivUrisInTriples( $triples, $propUrisFilter = null ) {
$equivUriCache = array();
foreach ( $triples as $tripleidx => $triple ) {
- 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 convert
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function convert( $arc2Triples, $arc2ResourceIndex, $arc2NSPrefixes ) {
// Instatiate wiki title converters (converting from URI and related RDF data to Wiki Title)
$uriToTitleConv = new RDFIOURIToWikiTitleConverter( $arc2Triples, $arc2ResourceIndex, $arc2NSPrefixes );
$uriToPropTitleConv = new RDFIOURIToPropertyTitleConverter( $arc2Triples, $arc2ResourceIndex, $arc2NSPrefixes );
- 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 convert
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function convert( $arc2Triples, $arc2ResourceIndex, $arc2NSPrefixes ) {
// Instatiate wiki title converters (converting from URI and related RDF data to Wiki Title)
$uriToTitleConv = new RDFIOURIToWikiTitleConverter( $arc2Triples, $arc2ResourceIndex, $arc2NSPrefixes );
$uriToPropTitleConv = new RDFIOURIToPropertyTitleConverter( $arc2Triples, $arc2ResourceIndex, $arc2NSPrefixes );
Method getHTMLForm
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getHTMLForm( $query = '' ) {
$wRequest = $this->getRequest();
$wUser = $this->getUser();
$uriResolverURI = SpecialPage::getTitleFor( 'URIResolver' )->getFullURL() . '/';
$defaultQuery = "@PREFIX w : <$uriResolverURI> .\n\nSELECT *\nWHERE { ?s ?p ?o }\nLIMIT 25";
Function execute
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$inFile = $this->getOption( 'in', '' );
$chunksize = intval( $this->getOption( 'chunksize', 0 ) );
$chunksleep = floatval( $this->getOption( 'chunksleep', 0.0 ) );
$offset = intval( $this->getOption( 'offset', 0 ) );
- 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 SpecialRDFImport.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
class RDFImport extends RDFIOSpecialPage {
function __construct() {
Function import
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function import( $limit = 25, $offset = 0 ) {
$wOut = $this->getOutput();
$wRequest = $this->getRequest();
$externalSparqlUrl = $wRequest->getText( 'extsparqlurl' );
- 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 getHTMLFormContent
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHTMLFormContent( $requestData, $user, $extraFormContent = '' ) {
$textfieldHiddenHTML = '';
$urlChecked = ( $requestData->importSource === 'url' );
$textfieldChecked = ( $requestData->importSource === 'textfield' );
Method execute
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function execute( $par ) {
unset( $par ); // Needed to suppress warning about unused variable which we include just for consistency.
// Require rdfio-admin permission for the current user
if ( !$this->userCanExecute( $this->getUser() ) ) {
Function importData
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function importData( RDFIORequestData $requestData ) {
$rdfImporter = new RDFIORDFImporter();
if ( $requestData->importSource === 'url' ) {
if ( $requestData->externalRdfUrl === '' ) {
throw new RDFIOException( 'URL field is empty!' );
- 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 import
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function import( $wikiPages ) {
// ----------------------------------------------------------------------
// 1. Loop over wiki pages
// ----------------------------------------------------------------------
- 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 applyGlobalSettingForPropertiesToUseAsWikiTitle
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function applyGlobalSettingForPropertiesToUseAsWikiTitle( $uri ) {
global $rdfiogTitleProperties;
$title = '';
- 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 splitURI
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function splitURI( $uri ) {
global $rdfiogBaseURIs;
/* ADAPTED FROM ARC2 WITH SOME MODIFICATIONS
* the following namespaces may lead to conflated URIs,
* we have to set the split position manually
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
function execute( $par ) {
unset( $par ); // Needed to suppress warning about unused variable which we include just for consistency.
// Require rdfio-import permission for the current user
if ( !$this->userCanExecute( $this->getUser() ) ) {
- 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 execute
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$inFile = $this->getOption( 'in', '' );
$chunksize = intval( $this->getOption( 'chunksize', 0 ) );
$chunksleep = floatval( $this->getOption( 'chunksleep', 0.0 ) );
$offset = intval( $this->getOption( 'offset', 0 ) );
Function toEquivURIsInSparqlResults
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function toEquivURIsInSparqlResults( $sparqlResult ) {
$rows = $sparqlResult['result']['rows'];
$vars = $sparqlResult['result']['variables'];
foreach ( $rows as $rowid => $row ) {
foreach ( $vars as $var ) {
- 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 import
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import( $wikiPages ) {
// ----------------------------------------------------------------------
// 1. Loop over wiki pages
// ----------------------------------------------------------------------
Method execute
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
unset( $par ); // Needed to suppress warning about unused variable which we include just for consistency.
// Require rdfio-sparql permission for the current user
if ( !$this->userCanExecute( $this->getUser() ) ) {
Method execute
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$outPath = $this->getOption( 'out', '' );
// Serialize to selected output format
$format = $this->getOption( 'format', 'rdfxml' );