Showing 51 of 158 total issues
Method executeReadOnlyQuery
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function executeReadOnlyQuery( $options ) {
$wikiOut = $this->getOutput();
$outputSer = $this->passSparqlToARC2AndGetSerializedOutput();
Method import
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function import( $limit = 25, $offset = 0 ) {
$wOut = $this->getOutput();
$wRequest = $this->getRequest();
$externalSparqlUrl = $wRequest->getText( 'extsparqlurl' );
Function execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$outPath = $this->getOption( 'out', '' );
// Serialize to selected output format
$format = $this->getOption( 'format', 'rdfxml' );
- 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 create
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function create() {
$wikiPageData = array(
'Category:RDFIO Data Source' => array(
'title' => 'RDFIO Data Source',
Method toEquivUrisInTriples
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function toEquivUrisInTriples( $triples, $propUrisFilter = null ) {
$equivUriCache = array();
foreach ( $triples as $tripleidx => $triple ) {
Method getExampleRDFXMLData
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getExampleRDFXMLData() {
return '<rdf:RDF\\n\
xmlns:rdf=\\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\\"\\n\
xmlns:cd=\\"http://www.recshop.fake/cd#\\"\\n\
xmlns:countries=\\"http://www.countries.org/onto/\\"\\n\
Function executeReadOnlyQuery
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function executeReadOnlyQuery( $options ) {
$wikiOut = $this->getOutput();
$outputSer = $this->passSparqlToARC2AndGetSerializedOutput();
- 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 33 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-import permission for the current user
if ( !$this->userCanExecute( $this->getUser() ) ) {
Method getJsCode
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getJsCode() {
$jsCode = '
<script type="text/javascript">
function pasteExampleRDFXMLData(textFieldId) {
var textfield = document.getElementById(textFieldId);
Method execute
has 32 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-import permission for the current user
if ( !$this->userCanExecute( $this->getUser() ) ) {
Method showImportedTriples
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showImportedTriples( $triples ) {
$output = "";
$styleCss = <<<EOD
table .rdfio- th {
font-weight: bold;
Method updateData
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateData( SMWSemanticData $data ) {
// NOTE: Should doDataUpdate() be used instead? (See SMWStore class)
$exportData = SMWExporter::getInstance()->makeExportData( $data );
$subjectUri = SMWExporter::getInstance()->expandURI( $exportData->getSubject()->getUri() );
Method extendQueryPatternsWithEquivUriLinks
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function extendQueryPatternsWithEquivUriLinks( $patterns ) {
$patternIdx = 0;
foreach ( $patterns as $pattern ) {
$equivUriUris = array(
's' => $this->storewrapper->getEquivURIURI(),
Method getExampleTurtleData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getExampleTurtleData() {
$exampleData = <<<EOT
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\\n\
@prefix cd: <http://www.recshop.fake/cd#> .\\n\
@prefix countries: <http://www.countries.org/onto/> .\\n\
Method splitURI
has 29 lines of code (exceeds 25 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
Method getHTMLForm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getHTMLForm( $buttonText, $limit, $offset ) {
global $wgArticlePath;
$wRequest = $this->getRequest();
$wUser = $this->getUser();
Method importData
has 27 lines of code (exceeds 25 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!' );
Function updateData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function updateData( SMWSemanticData $data ) {
// NOTE: Should doDataUpdate() be used instead? (See SMWStore class)
$exportData = SMWExporter::getInstance()->makeExportData( $data );
$subjectUri = SMWExporter::getInstance()->expandURI( $exportData->getSubject()->getUri() );
- 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 getURIForEquivURI
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getURIForEquivURI( $equivUri, $isProperty = false ) {
$uri = '';
if ( $isProperty ) {
$equivUriUri = self::EQUIV_PROPERTY_URI;
} else {
- 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 showImportedTriples
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function showImportedTriples( $triples ) {
$output = "";
$styleCss = <<<EOD
table .rdfio- th {
font-weight: bold;
- 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"