Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-22597

Error 404 when trying to access language details for "C/C++ Header"

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • sloccount-plugin
    • None
    • Jenkins SLOCCount Plug-in 1.18
      Jenkins 1.509.2
      cloc 1.60

      I'm using SLOCCOunt plugin with cloc for C++ project.

      The cloc program reports *.h files as 'C/C++ Header' language, but SLOCCount plugin fails to properly handle slash character, and generates links to a page:
      http://SERVER_NAME:8080/job/JOB_NAME/50/sloccountResult/languageResult/C/C++%20Header

      which results in the following error 404:

      Status Code: 404
      Exception:
      Stacktrace:

      (none)

      I can see cloc program has few other languages with '/', most probably the plugin will fail for them as well:

      [4]/home/robert> cloc --show-lang | grep /
      ADSO/IDSM (adso)
      C/C++ Header (h, H, hh, hpp)
      Lisp/OpenCL (cl)
      PHP/Pascal (inc)
      Tcl/Tk (itk, tcl, tk)
      [5]/home/robert> cloc --version
      1.60

          [JENKINS-22597] Error 404 when trying to access language details for "C/C++ Header"

          Michal Turek added a comment -

          Thanks for the report, I will look at it.

          Michal Turek added a comment - Thanks for the report, I will look at it.

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/java/hudson/plugins/sloccount/SloccountDiffLanguage.java
          src/main/java/hudson/plugins/sloccount/SloccountResult.java
          src/main/java/hudson/plugins/sloccount/model/Folder.java
          src/main/java/hudson/plugins/sloccount/model/Language.java
          src/main/java/hudson/plugins/sloccount/model/Module.java
          src/main/java/hudson/plugins/sloccount/util/HtmlUtil.java
          src/main/resources/hudson/plugins/sloccount/SloccountBuildAction/summary.jelly
          src/main/resources/hudson/plugins/sloccount/SloccountResult/languages.jelly
          src/main/resources/hudson/plugins/sloccount/SloccountResult/modules.jelly
          http://jenkins-ci.org/commit/sloccount-plugin/28a918161d2764805825f34e012504f04c8670f7
          Log:
          JENKINS-22597 Error 404 when trying to access language details for "C/C++ Header"

          • Helper method HtmlUtil.urlEncode() defined.
          • getUrlName() method added to Folder, Language and Module classes and used for all URLs in HTML links.
          • URL decoding is done out of the box in SloccountResult.get*Result() methods.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/java/hudson/plugins/sloccount/SloccountDiffLanguage.java src/main/java/hudson/plugins/sloccount/SloccountResult.java src/main/java/hudson/plugins/sloccount/model/Folder.java src/main/java/hudson/plugins/sloccount/model/Language.java src/main/java/hudson/plugins/sloccount/model/Module.java src/main/java/hudson/plugins/sloccount/util/HtmlUtil.java src/main/resources/hudson/plugins/sloccount/SloccountBuildAction/summary.jelly src/main/resources/hudson/plugins/sloccount/SloccountResult/languages.jelly src/main/resources/hudson/plugins/sloccount/SloccountResult/modules.jelly http://jenkins-ci.org/commit/sloccount-plugin/28a918161d2764805825f34e012504f04c8670f7 Log: JENKINS-22597 Error 404 when trying to access language details for "C/C++ Header" Helper method HtmlUtil.urlEncode() defined. getUrlName() method added to Folder, Language and Module classes and used for all URLs in HTML links. URL decoding is done out of the box in SloccountResult.get*Result() methods.

          Code changed in jenkins
          User: Michal Turek
          Path:
          src/main/java/hudson/plugins/sloccount/SloccountDiffLanguage.java
          src/main/java/hudson/plugins/sloccount/SloccountResult.java
          src/main/java/hudson/plugins/sloccount/model/Folder.java
          src/main/java/hudson/plugins/sloccount/model/Language.java
          src/main/java/hudson/plugins/sloccount/model/Module.java
          src/main/java/hudson/plugins/sloccount/util/HtmlUtil.java
          src/main/resources/hudson/plugins/sloccount/SloccountBuildAction/summary.jelly
          src/main/resources/hudson/plugins/sloccount/SloccountResult/languages.jelly
          src/main/resources/hudson/plugins/sloccount/SloccountResult/modules.jelly
          http://jenkins-ci.org/commit/sloccount-plugin/f98c8ca5116bc8252dbad571272269de850aae7e
          Log:
          Merge pull request #41 from mixalturek/master

          JENKINS-22597 Error 404 when trying to access language details for "C/...

          Compare: https://github.com/jenkinsci/sloccount-plugin/compare/a75e1a064e9b...f98c8ca5116b

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Michal Turek Path: src/main/java/hudson/plugins/sloccount/SloccountDiffLanguage.java src/main/java/hudson/plugins/sloccount/SloccountResult.java src/main/java/hudson/plugins/sloccount/model/Folder.java src/main/java/hudson/plugins/sloccount/model/Language.java src/main/java/hudson/plugins/sloccount/model/Module.java src/main/java/hudson/plugins/sloccount/util/HtmlUtil.java src/main/resources/hudson/plugins/sloccount/SloccountBuildAction/summary.jelly src/main/resources/hudson/plugins/sloccount/SloccountResult/languages.jelly src/main/resources/hudson/plugins/sloccount/SloccountResult/modules.jelly http://jenkins-ci.org/commit/sloccount-plugin/f98c8ca5116bc8252dbad571272269de850aae7e Log: Merge pull request #41 from mixalturek/master JENKINS-22597 Error 404 when trying to access language details for "C/... Compare: https://github.com/jenkinsci/sloccount-plugin/compare/a75e1a064e9b...f98c8ca5116b

          Michal Turek added a comment -

          Fixed, will be released in version 1.19.

          Michal Turek added a comment - Fixed, will be released in version 1.19.

          jlpinardon added a comment -

          The bug appears to be still present when using sloccount 1.24 on a Jenkins core 2.222.3 with cloc results published in a jenkinsfile.

          jlpinardon added a comment - The bug appears to be still present when using sloccount 1.24 on a Jenkins core 2.222.3 with cloc results published in a jenkinsfile.

            mixalturek Michal Turek
            robbl Robert Luberda
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: