Violation and pylint problem in file report page

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

Violation and pylint problem in file report page

Erik Ramfelt
I created a PyLint parser to the violations plugin and it parses the
pylint report nicely.

But when I view the Per file report, I dont see the name of the file
next to the violation icon. Neither do I see a list of the violations
in that file. But the snippets from the source code is displayed ok
with all the violations.

There must be something that I missed, but is it a problem with the
FullFileModel/FullBuildModel/Violation?


BTW, it was very simple to create the report! Nicely done with the plugin core!

//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Peter Reilly-2
On 8/29/07, Erik Ramfelt <[hidden email]> wrote:
> I created a PyLint parser to the violations plugin and it parses the
> pylint report nicely.
>
> But when I view the Per file report, I dont see the name of the file
> next to the violation icon. Neither do I see a list of the violations
> in that file. But the snippets from the source code is displayed ok
> with all the violations.
Thats strange!

>
> There must be something that I missed, but is it a problem with the
> FullFileModel/FullBuildModel/Violation?
>
>
> BTW, it was very simple to create the report! Nicely done with the plugin core!
Can you commit the code?
It would be nice to have it in the next Violations release.

Peter
>
> //Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Erik Ramfelt
On 8/30/07, Peter Reilly <[hidden email]> wrote:
> On 8/29/07, Erik Ramfelt <[hidden email]> wrote:
> > But when I view the Per file report, I dont see the name of the file
> > next to the violation icon. Neither do I see a list of the violations
> > in that file. But the snippets from the source code is displayed ok
> > with all the violations.
> Thats strange!

I guess it is a problem with the File objects.


This makes me think about the FxCop which I really want (not that
again). What do you think about if it would be possible to tell the a
FullFileModel that it should ignore the code snippets; and only
display the list of violations for a file? That way I can add DLL's
and what nots.


> > BTW, it was very simple to create the report! Nicely done with the plugin core!
> Can you commit the code?
> It would be nice to have it in the next Violations release.

Sure, I will add it later today.

//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Peter Reilly-2
On 8/30/07, Erik Ramfelt <[hidden email]> wrote:

> On 8/30/07, Peter Reilly <[hidden email]> wrote:
> > On 8/29/07, Erik Ramfelt <[hidden email]> wrote:
> > > But when I view the Per file report, I dont see the name of the file
> > > next to the violation icon. Neither do I see a list of the violations
> > > in that file. But the snippets from the source code is displayed ok
> > > with all the violations.
> > Thats strange!
>
> I guess it is a problem with the File objects.
>
>
> This makes me think about the FxCop which I really want (not that
> again). What do you think about if it would be possible to tell the a
> FullFileModel that it should ignore the code snippets; and only
> display the list of violations for a file? That way I can add DLL's
> and what nots.
It does this at the moment - just give a name of a file that does
not exist.

This is what is done with findbugs, where the file for a class
in violation is not found. A filename is constructed from the classname,
(com.company.project.ClassName -> com/comany/project/ClassName.java)
and this is used for the file report - it just gives the list of violations.

>
>
> > > BTW, it was very simple to create the report! Nicely done with the plugin core!
> > Can you commit the code?
> > It would be nice to have it in the next Violations release.
>
> Sure, I will add it later today.
Excellent.
I will have a look at it and see if the File Object problem can be fixed.

Peter

>
> //Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Erik Ramfelt
> On 8/30/07, Peter Reilly <[hidden email]> wrote:
> > > > BTW, it was very simple to create the report! Nicely done with the plugin core!
> > > Can you commit the code?
> > > It would be nice to have it in the next Violations release.
> >
> > Sure, I will add it later today.
> Excellent.
> I will have a look at it and see if the File Object problem can be fixed.

Ive commited it now, and I added an unit test to test my regexs, hope
you didnt mind adding a src/test/java folder?


Do you need report data or files, let me know and I can send you some quickly.

//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Peter Reilly-2
On 8/30/07, Erik Ramfelt <[hidden email]> wrote:

> > On 8/30/07, Peter Reilly <[hidden email]> wrote:
> > > > > BTW, it was very simple to create the report! Nicely done with the plugin core!
> > > > Can you commit the code?
> > > > It would be nice to have it in the next Violations release.
> > >
> > > Sure, I will add it later today.
> > Excellent.
> > I will have a look at it and see if the File Object problem can be fixed.
>
> Ive commited it now, and I added an unit test to test my regexs, hope
> you didnt mind adding a src/test/java folder?
>
>
> Do you need report data or files, let me know and I can send you some quickly.
Yes, I cannot get pylint to work, (it complains of a missing module
logilab.astng.utils)

Peter

>
> //Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Erik Ramfelt
On 8/30/07, Peter Reilly <[hidden email]> wrote:
> On 8/30/07, Erik Ramfelt <[hidden email]> wrote:
> > Do you need report data or files, let me know and I can send you some quickly.
> Yes, I cannot get pylint to work, (it complains of a missing module
> logilab.astng.utils)

If you download the same workspace as Im using, then you should be
able to get the report parsing to work, right? A tgz of the workspace
is located here: http://ramfelt.se/tmp/ws.tgz

The pylint report is pylint.parsable.


//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Peter Reilly-2
Thanks,
I tried that and did not see anything wrong
The file report page looks good.
Peter


On 8/30/07, Erik Ramfelt <[hidden email]> wrote:

> On 8/30/07, Peter Reilly <[hidden email]> wrote:
> > On 8/30/07, Erik Ramfelt <[hidden email]> wrote:
> > > Do you need report data or files, let me know and I can send you some quickly.
> > Yes, I cannot get pylint to work, (it complains of a missing module
> > logilab.astng.utils)
>
> If you download the same workspace as Im using, then you should be
> able to get the report parsing to work, right? A tgz of the workspace
> is located here: http://ramfelt.se/tmp/ws.tgz
>
> The pylint report is pylint.parsable.
>
>
> //Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Peter Reilly-2
I am going to rearrange the package structure slightly (move the
different violation parsing types to their own packages).

Peter

On 8/30/07, Peter Reilly <[hidden email]> wrote:

> Thanks,
> I tried that and did not see anything wrong
> The file report page looks good.
> Peter
>
>
> On 8/30/07, Erik Ramfelt <[hidden email]> wrote:
> > On 8/30/07, Peter Reilly <[hidden email]> wrote:
> > > On 8/30/07, Erik Ramfelt <[hidden email]> wrote:
> > > > Do you need report data or files, let me know and I can send you some quickly.
> > > Yes, I cannot get pylint to work, (it complains of a missing module
> > > logilab.astng.utils)
> >
> > If you download the same workspace as Im using, then you should be
> > able to get the report parsing to work, right? A tgz of the workspace
> > is located here: http://ramfelt.se/tmp/ws.tgz
> >
> > The pylint report is pylint.parsable.
> >
> >
> > //Erik
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Peter Reilly-2
I have made the changes
  all the violations parsing types now have their own package
  - h.p.v.types.<ViolationType>

Also I tested the pylint plugin with the example tarball, and it
looks fine on windows as well linux.

Peter


On 8/30/07, Peter Reilly <[hidden email]> wrote:

> I am going to rearrange the package structure slightly (move the
> different violation parsing types to their own packages).
>
> Peter
>
> On 8/30/07, Peter Reilly <[hidden email]> wrote:
> > Thanks,
> > I tried that and did not see anything wrong
> > The file report page looks good.
> > Peter
> >
> >
> > On 8/30/07, Erik Ramfelt <[hidden email]> wrote:
> > > On 8/30/07, Peter Reilly <[hidden email]> wrote:
> > > > On 8/30/07, Erik Ramfelt <[hidden email]> wrote:
> > > > > Do you need report data or files, let me know and I can send you some quickly.
> > > > Yes, I cannot get pylint to work, (it complains of a missing module
> > > > logilab.astng.utils)
> > >
> > > If you download the same workspace as Im using, then you should be
> > > able to get the report parsing to work, right? A tgz of the workspace
> > > is located here: http://ramfelt.se/tmp/ws.tgz
> > >
> > > The pylint report is pylint.parsable.
> > >
> > >
> > > //Erik
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden email]
> > > For additional commands, e-mail: [hidden email]
> > >
> > >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Erik Ramfelt
Great, and I tested the Pylint plugin and it works as it should. I
dont know what happened before :/


The PyLint parser doesnt do anything with the sourcePaths in the
parse() method. Should it parse through the source path's if it cant
find the File for a certain violation? From what I can see it is only
the Findbugs that actually uses the paths.

cheers
//Erik

On 8/31/07, Peter Reilly <[hidden email]> wrote:
> I have made the changes
>   all the violations parsing types now have their own package
>   - h.p.v.types.<ViolationType>
>
> Also I tested the pylint plugin with the example tarball, and it
> looks fine on windows as well linux.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Peter Reilly-2
On 8/31/07, Erik Ramfelt <[hidden email]> wrote:
> Great, and I tested the Pylint plugin and it works as it should. I
> dont know what happened before :/
>
>
> The PyLint parser doesnt do anything with the sourcePaths in the
> parse() method. Should it parse through the source path's if it cant
> find the File for a certain violation? From what I can see it is only
> the Findbugs that actually uses the paths.
>
The source paths correspond to the
"source path pattern" configuration.

Looking at the pylint xml output, the filenames are relative
and not absolute. Your code assumes that the filenames are
relative to the hudson workspace, but this may not always be the
case.

In the checkstyle, pmd, cpd  reports, filenames are absolute - so there
is no need for worry about where the root of the source is.

In the findbugs report, the filenames are relative, however the report
normally contains the absolute paths for the source roots (this does
not happen the the report generated by the maven findbugs plugin).

Peter

> cheers
> //Erik
>
> On 8/31/07, Peter Reilly <[hidden email]> wrote:
> > I have made the changes
> >   all the violations parsing types now have their own package
> >   - h.p.v.types.<ViolationType>
> >
> > Also I tested the pylint plugin with the example tarball, and it
> > looks fine on windows as well linux.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Erik Ramfelt
On 8/31/07, Peter Reilly <[hidden email]> wrote:
> On 8/31/07, Erik Ramfelt <[hidden email]> wrote:
> > The PyLint parser doesnt do anything with the sourcePaths in the
> > parse() method. Should it parse through the source path's if it cant
> > find the File for a certain violation? From what I can see it is only
> > the Findbugs that actually uses the paths.
> In the findbugs report, the filenames are relative, however the report
> normally contains the absolute paths for the source roots (this does
> not happen the the report generated by the maven findbugs plugin).

Ok, I fixed the PyLint parser so it would look through the source
paths to find the absolute paths. And if you dont mind I will lift out
the logic for searching the source paths to a util class so other
parses (like FxCop) can use them.

It would be nice if there was an abstract parser that other non-XML
parser could use where similar functionality could be put.


As .NET projects probably only are going to use FxCop (and perhaps
CPD), it feels like the main graph is wasted as it will only show one
line. As FxCop (and probably other tools) group the violations in
different groups, it would be very simple to add a sub type for
Violation that contains the group type. And if the user would like to
see a little more detailed graph for a certain tool, then they would
check a "Group violations by sub type" which is a per-tool
configuration.

I tried it quickly by setting violation.setType("fxcop-Design"),
violation.setType("fxcop-Naming"), etc. The result was that I got more
detailed lines for the different types of fxcop violations.

What do you think? For my current job, I know I will use the sub group
idea, and therefore I could make the changes for the rest if you like
the idea.

cheers
//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Peter Reilly-2
On 9/10/07, Erik Ramfelt <[hidden email]> wrote:

> On 8/31/07, Peter Reilly <[hidden email]> wrote:
> > On 8/31/07, Erik Ramfelt <[hidden email]> wrote:
> > > The PyLint parser doesnt do anything with the sourcePaths in the
> > > parse() method. Should it parse through the source path's if it cant
> > > find the File for a certain violation? From what I can see it is only
> > > the Findbugs that actually uses the paths.
> > In the findbugs report, the filenames are relative, however the report
> > normally contains the absolute paths for the source roots (this does
> > not happen the the report generated by the maven findbugs plugin).
>
> Ok, I fixed the PyLint parser so it would look through the source
> paths to find the absolute paths. And if you dont mind I will lift out
> the logic for searching the source paths to a util class so other
> parses (like FxCop) can use them.
That sounds good.
>
> It would be nice if there was an abstract parser that other non-XML
> parser could use where similar functionality could be put.
>
That would be nice:
class MyParser extends AbstactLineParser {
   @Override
   public void parseLine(FullBuildModel model, String line) {
      ...
      uses: File<-super.getFileForName(name)
               FullFileModel<-super.getFileModel(model, name, file)
  }

>
> As .NET projects probably only are going to use FxCop (and perhaps
> CPD), it feels like the main graph is wasted as it will only show one
> line. As FxCop (and probably other tools) group the violations in
> different groups, it would be very simple to add a sub type for
> Violation that contains the group type. And if the user would like to
> see a little more detailed graph for a certain tool, then they would
> check a "Group violations by sub type" which is a per-tool
> configuration.
>
> I tried it quickly by setting violation.setType("fxcop-Design"),
> violation.setType("fxcop-Naming"), etc. The result was that I got more
> detailed lines for the different types of fxcop violations.
>
> What do you think? For my current job, I know I will use the sub group
> idea, and therefore I could make the changes for the rest if you like
> the idea.

I am not too sure.
In my env, we use 3 types (findbugs, checkstyle and pmd) (sometimes
cpd).
I think what we will add more (some xml file checker, c++, c simple
checkers (notabs, linelengths etc)

What would be really cool would be a tabbed graph,
with a main tab for all the violation types, and a tab for
each type. If there was only one violation type defined, the
violation type graph would be the only one displayed - this
could include the different subtypes - or the severity levels.

Peter

>
> cheers
> //Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Violation and pylint problem in file report page

Erik Ramfelt
On 9/10/07, Peter Reilly <[hidden email]> wrote:

> On 9/10/07, Erik Ramfelt <[hidden email]> wrote:
> > It would be nice if there was an abstract parser that other non-XML
> > parser could use where similar functionality could be put.
> >
> That would be nice:
> class MyParser extends AbstactLineParser {
>    @Override
>    public void parseLine(FullBuildModel model, String line) {
>       ...
>       uses: File<-super.getFileForName(name)
>                FullFileModel<-super.getFileModel(model, name, file)
>   }

Yeah, something along that line, the best name would be
AbstractTypeParser, but it already exists and extends the
AbstractParser which is an XML parser. How about changing the name of
AbstractParser to AbstractXmlParser and AbstractTypeParser to
AbstractTypeXmlParser? That way we could have the AbstractTypeParser
which would be more specific for the violation type parsing and not
contain the XML parts.


> > As .NET projects probably only are going to use FxCop (and perhaps
> > CPD), it feels like the main graph is wasted as it will only show one
> > line. As FxCop (and probably other tools) group the violations in
> > different groups, it would be very simple to add a sub type for
> > Violation that contains the group type. And if the user would like to
> > see a little more detailed graph for a certain tool, then they would
> > check a "Group violations by sub type" which is a per-tool
> > configuration.
> > What do you think? For my current job, I know I will use the sub group
> > idea, and therefore I could make the changes for the rest if you like
> > the idea.
>
> I am not too sure.
> In my env, we use 3 types (findbugs, checkstyle and pmd) (sometimes
> cpd).
> I think what we will add more (some xml file checker, c++, c simple
> checkers (notabs, linelengths etc)

Yeah, I know it would quickly be too much data in the graph, but if
the default would be today's behaviour; and then the user would be
able to check a check box that would list the sub types? (For PMD that
would be the rule sets, and for findbugs the category)


> What would be really cool would be a tabbed graph,
> with a main tab for all the violation types, and a tab for
> each type. If there was only one violation type defined, the
> violation type graph would be the only one displayed - this
> could include the different subtypes - or the severity levels.

That would be very cool, but I have no clue on how to do it :)


regards
//Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]