timothycrosley / deprecated.frosted

A simple program which checks Python source files for errors.
MIT License
250 stars 23 forks source link

Feature Request: Add more checks #40

Open msmhrt opened 10 years ago

msmhrt commented 10 years ago

I think it would be nice if frosted can check the following code.

def a(b):
    if b:
        c = 1
    return c  # variable 'c' may not exist
def a():
    b = 0  # this line should be error "local variable 'b' is assigned to but never used"
    return
    b += 1  # unreachable code
timothycrosley commented 10 years ago

Thanks for finding these failure cases! I'll put a fix in for them prior to the next release.

~Timothy

smokey42 commented 10 years ago

On the other hand, the unreachable code should be a warning as well. :)

zoidyzoidzoid commented 10 years ago

Should frosted be picking up undeclared variables at the moment?