lint check

3 December 2004


( /*
search for potential class not found errors

look in all classes, in all methods for likely class names
ie. if first character of symbol is a capital letter
but are not actually classes

it will match on AIFF SD2 etc., but is otherwise quite useful
*/ Class.allClasses.do({ arg class;
(class.methods ?? {[]}).do({ arg method;
var literals;
literals = method.literals;
if(literals.notNil,{
literals.do({ arg lit;
if(lit.isKindOf(Symbol) and: { lit.isClassName },{
if(lit.asClass.isNil,{
lit.post;
(30 - lit.asString.size).do({ " ".post; });
(class.name.asString ++ "::" ++ method.name.asString).postln;
})
})
})
});
})
}); ) (
/*
search for potential method not found errors

look through all methods for method selectors that
are not defined for any class

this finds many false cases because it matches any symbol.
so it finds 'AIFF' etc.

but i found a good 7 or 8 typos in mine and others code

// could reject any spec names
// any instr names
// sound file types */ var allMethodNames;
allMethodNames = IdentityDictionary.new; Class.allClasses.do({ arg class;
(class.methods ?? {[]}).do({ arg method;
allMethodNames.put(method.name,true);
})
}); Class.allClasses.do({ arg class;
(class.methods ?? {[]}).do({ arg method;
var literals;
literals = method.literals;
if(literals.notNil,{
literals.do({ arg lit;
if(lit.isKindOf(Symbol) and: { lit.isClassName.not },{
if(allMethodNames.at(lit).isNil,{
lit.post;
(30 - lit.asString.size).do({ " ".post; });
(class.name.asString ++ "::" ++ method.name.asString).postln;
})
})
})
});
})
}); )


  1. 1 web development says...

    Humm… interesting,

    This is really helpful,

    Works for me,

    Keep up the good work,

    Thanks for writing about it