Showing 158 of 158 total issues

Avoid excessively long variable names like $rdfiogQueryByEquivURIs. Keep variable name length under 20.
Open

        global $rdfiogQueryByEquivURIs, $rdfiogOutputEquivUris;
Severity: Minor
Found in specials/SpecialSPARQLEndpoint.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $rdfiogTitleProperties. Keep variable name length under 20.
Open

        global $rdfiogTitleProperties;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $rdfiogTitleProperties. Keep variable name length under 20.
Open

        global $rdfiogTitleProperties;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $rdfiogTitleProperties. Keep variable name length under 20.
Open

        global $rdfiogTitleProperties;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

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' );

Severity: Minor
Found in maintenance/exportRdf.php - About 1 hr to fix

    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() ) ) {
    Severity: Minor
    Found in specials/SpecialSPARQLEndpoint.php - About 1 hr to fix

      Method import has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function import( $wikiPages ) {
      
              // ----------------------------------------------------------------------
              //  1. Loop over wiki pages
              // ----------------------------------------------------------------------
      Severity: Minor
      Found in classes/RDFIO_SMWPageWriter.php - About 1 hr to fix

        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' );
        Severity: Minor
        Found in specials/SpecialSPARQLImport.php - About 1 hr to fix

          Method executeReadOnlyQuery has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function executeReadOnlyQuery( $options ) {
                  $wikiOut = $this->getOutput();
          
                  $outputSer = $this->passSparqlToARC2AndGetSerializedOutput();
          
          
          Severity: Minor
          Found in specials/SpecialSPARQLEndpoint.php - About 1 hr to fix

            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' );
            
            
            Severity: Minor
            Found in maintenance/exportRdf.php - About 1 hr to fix

            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',
            Severity: Minor
            Found in classes/RDFIO_CreatePagesOnInstall.php - About 1 hr to fix

              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 ) {
              Severity: Minor
              Found in classes/RDFIO_ARC2StoreWrapper.php - About 1 hr to fix

                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\
                Severity: Minor
                Found in specials/SpecialRDFImport.php - About 1 hr to fix

                  Function executeReadOnlyQuery has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function executeReadOnlyQuery( $options ) {
                          $wikiOut = $this->getOutput();
                  
                          $outputSer = $this->passSparqlToARC2AndGetSerializedOutput();
                  
                  
                  Severity: Minor
                  Found in specials/SpecialSPARQLEndpoint.php - About 1 hr to fix

                  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() ) ) {
                  Severity: Minor
                  Found in specials/SpecialSPARQLImport.php - About 1 hr to fix

                    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);
                    Severity: Minor
                    Found in specials/SpecialRDFImport.php - About 1 hr to fix

                      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() ) ) {
                      Severity: Minor
                      Found in specials/SpecialRDFImport.php - About 1 hr to fix

                        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() );
                        
                        
                        Severity: Minor
                        Found in stores/SMW_ARC2Store.php - About 1 hr to fix

                          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;
                          Severity: Minor
                          Found in classes/RDFIO_RDFImporter.php - About 1 hr to fix

                            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(),
                            Severity: Minor
                            Found in specials/SpecialSPARQLEndpoint.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language