Menu

#990 cpd dont die on unreadable files

closed
nobody
None
5
2012-10-07
2012-01-13
Anonymous
No

cpd dont die on unreadable files

Discussion

  • Anonymous

    Anonymous - 2012-01-13

    In this case file 'redacted.h' is not readable by the jenkins user.
    (say it was created with wong umask)

    instead of aborting the whole analysis, can cpd just warn log about the file and continue!?

    19:55:12 java.io.FileNotFoundException: redacted.h (Permission denied)
    19:55:12 at java.io.FileInputStream.open(Native Method)
    19:55:12 at java.io.FileInputStream.<init>(FileInputStream.java:120)
    19:55:12 at net.sourceforge.pmd.cpd.SourceCode$FileCodeLoader.getReader(SourceCode.java:73)
    19:55:12 at net.sourceforge.pmd.cpd.SourceCode$CodeLoader.load(SourceCode.java:42)
    19:55:12 at net.sourceforge.pmd.cpd.SourceCode$CodeLoader.getCode(SourceCode.java:31)
    19:55:12 at net.sourceforge.pmd.cpd.SourceCode.getCodeBuffer(SourceCode.java:118)
    19:55:12 at net.sourceforge.pmd.cpd.CPPTokenizer.tokenize(CPPTokenizer.java:17)
    19:55:12 at net.sourceforge.pmd.cpd.CPD.add(CPD.java:107)
    19:55:12 at net.sourceforge.pmd.cpd.CPD.add(CPD.java:73)
    19:55:12 at net.sourceforge.pmd.cpd.CPD.addDirectory(CPD.java:83)
    19:55:12 at net.sourceforge.pmd.cpd.CPD.addRecursively(CPD.java:68)
    19:55:12 at net.sourceforge.pmd.cpd.CPD.main(CPD.java:200)</init>

     

    Last edit: Anonymous 2013-11-26
  • Steven Christou

    Steven Christou - 2012-01-13

    This looks like a file permissions issue. Do you have read/write permissions?

    instead of aborting the whole analysis, can cpd just warn log about the
    file and continue!?
    Why would you want to scan a file that the user doesn't have permission to access to begin with?

     
  • Romain PELISSE

    Romain PELISSE - 2012-01-15

    instead of aborting the whole analysis, can cpd just warn log about the file and continue!?
    Why would you want to scan a file that the user doesn't have permission to
    access to begin with?

    Well, in real life this can happen, especially within a CI server such as Jenkins. Simply ignoring unreadable file could make sense, but this need to be implemented.

    @Moncreg: I don't think anybody will do it but if you submit patch with the appropriate changes we will definitely look at it and try to apply it.

    As there is already to many bug reports right now and it's more like a feature request than a real, blocking I close this entry (sorry).

     

Log in to post a comment.

MongoDB Logo MongoDB