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

Severity: Minor
Found in specials/SpecialSPARQLEndpoint.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

      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 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 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 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

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

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

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

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

                                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() );
                                
                                
                                Severity: Minor
                                Found in stores/SMW_ARC2Store.php - About 55 mins 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

                                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 {
                                Severity: Minor
                                Found in classes/RDFIO_ARC2StoreWrapper.php - About 45 mins 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

                                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;
                                Severity: Minor
                                Found in classes/RDFIO_RDFImporter.php - About 35 mins 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

                                Severity
                                Category
                                Status
                                Source
                                Language