Code Analysis

View: New views
4 Messages — Rating Filter:   Alert me  

Code Analysis

by Nikolaus Rath :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I am currently testing the code analysis offered by Pydev Extensions. I
think I really like the analysis itself (it directly showed me quite
some places where I could clean up and improve my code), but I am
confused by what exactly is included in the analysis:

Sometimes I get errors and warnings from a file only after I have opened
it, so I concluded that code analysis is only done on open files.

Then, however, I tried get rid of a couple of errors by closing the
respective file (expecting this would exclude it from the code
analysis). However, the errors are still shown.


Is there a way to have the code analysis run on all files in the
project (no matter if currently open or not) and to exclude some
individual files completely (again, no matter if open or not)?


Best,


   -Nikolaus

--
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

Re: Code Analysis

by Fabio Zadrozny-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I am currently testing the code analysis offered by Pydev Extensions. I
> think I really like the analysis itself (it directly showed me quite
> some places where I could clean up and improve my code), but I am
> confused by what exactly is included in the analysis:
>
> Sometimes I get errors and warnings from a file only after I have opened
> it, so I concluded that code analysis is only done on open files.
>
> Then, however, I tried get rid of a couple of errors by closing the
> respective file (expecting this would exclude it from the code
> analysis). However, the errors are still shown.
>
> Is there a way to have the code analysis run on all files in the
> project (no matter if currently open or not) and to exclude some
> individual files completely (again, no matter if open or not)?

Right now it works in the following way:

Any valid python file that maps to a python module (with __init__.py
along the way) under a source folder will be analyzed when:
- the file changes
- the file is opened

But it won't automatically analyze all the existing files -- if you
want that you can force pydev to do so by doing a project > clean and
select which project(s) should have the files analyzed.

The only way to ignore a file under the pythonpath in the analysis is
by adding a comment: #@PydevCodeAnalysisIgnore in the file that should
not be analyzed.

Cheers,

Fabio

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

Re: Code Analysis

by Nikolaus Rath :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Fabio Zadrozny <fabiofz@...> writes:

>> I am currently testing the code analysis offered by Pydev Extensions. I
>> think I really like the analysis itself (it directly showed me quite
>> some places where I could clean up and improve my code), but I am
>> confused by what exactly is included in the analysis:
>>
>> Sometimes I get errors and warnings from a file only after I have opened
>> it, so I concluded that code analysis is only done on open files.
>>
>> Then, however, I tried get rid of a couple of errors by closing the
>> respective file (expecting this would exclude it from the code
>> analysis). However, the errors are still shown.
>>
>> Is there a way to have the code analysis run on all files in the
>> project (no matter if currently open or not) and to exclude some
>> individual files completely (again, no matter if open or not)?
>
> Right now it works in the following way:
>
> Any valid python file that maps to a python module (with __init__.py
> along the way) under a source folder will be analyzed when:
> - the file changes
> - the file is opened
>
> But it won't automatically analyze all the existing files -- if you
> want that you can force pydev to do so by doing a project > clean and
> select which project(s) should have the files analyzed.

That makes sense, thanks a lot. Just to make it absolutely clear: what
exactly does it mean for a file to "map to a python module"?

> The only way to ignore a file under the pythonpath in the analysis is
> by adding a comment: #@PydevCodeAnalysisIgnore in the file that should
> not be analyzed.

Arr. Now that you say it, I also remember that I have seen that in the
options window. Must have blocked that out for some reason.


Thanks!


   -Nikolaus

--
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C


------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users

Re: Code Analysis

by Fabio Zadrozny-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> That makes sense, thanks a lot. Just to make it absolutely clear: what
> exactly does it mean for a file to "map to a python module"?

It means that it must be under a source folder and all the folders to
get to it from the source folder have __init__.py files (so, you must
be able to import it properly).

Cheers,

Fabio

------------------------------------------------------------------------------
Are you an open source citizen? Join us for the Open Source Bridge conference!
Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250.
Need another reason to go? 24-hour hacker lounge. Register today!
http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
_______________________________________________
Pydev-users mailing list
Pydev-users@...
https://lists.sourceforge.net/lists/listinfo/pydev-users