@@ -87,7 +87,8 @@ allSmells = [
8787 " UsesFail" ,
8888 " UsesNamedSelfReference" ,
8989 " UsesUnificationOperator" ,
90- " JavaScript#UsesVarInsteadOfLet" ]
90+ " JavaScript#UsesVarInsteadOfLet" ,
91+ " JavaScript#UsesForInInsteadOfForOf" ]
9192
9293---
9394--- Instantiation
@@ -131,49 +132,50 @@ evalSmellInstance :: SmellsContext -> Expression -> SmellInstance -> [Expectatio
131132evalSmellInstance context expression smellInstance = map (expectationFor smellInstance) . detectionFor smellInstance context $ expression
132133
133134detectionFor :: SmellInstance -> Detection
134- detectionFor (" DiscardsExceptions" , Nothing ) = simple discardsExceptions
135- detectionFor (" DoesConsolePrint" , Nothing ) = simple doesConsolePrint
136- detectionFor (" DoesNilTest" , Nothing ) = simple doesNilTest
137- detectionFor (" DoesNullTest" , Nothing ) = simple doesNilTest
138- detectionFor (" DoesTypeTest" , Nothing ) = simple doesTypeTest
139- detectionFor (" HasAssignmentCondition" , Nothing ) = simple hasAssignmentCondition
140- detectionFor (" HasAssignmentReturn" , Nothing ) = simple hasAssignmentReturn
141- detectionFor (" HasCodeDuplication" , Nothing ) = unsupported
142- detectionFor (" HasDeclarationTypos" , Just target) = raw (detectDeclarationTypos target)
143- detectionFor (" HasEmptyIfBranches" , Nothing ) = simple hasEmptyIfBranches
144- detectionFor (" HasEmptyRepeat" , Nothing ) = simple hasEmptyRepeat
145- detectionFor (" HasEqualIfBranches" , Nothing ) = simple hasEqualIfBranches
146- detectionFor (" HasLongParameterList" , Nothing ) = simple hasLongParameterList
147- detectionFor (" HasMisspelledBindings" , Nothing ) = withLanguage hasMisspelledIdentifiers
148- detectionFor (" HasMisspelledIdentifiers" , Nothing ) = withLanguage hasMisspelledIdentifiers
149- detectionFor (" HasRedundantBooleanComparison" , Nothing ) = simple hasRedundantBooleanComparison
150- detectionFor (" HasRedundantGuards" , Nothing ) = simple hasRedundantGuards
151- detectionFor (" HasRedundantIf" , Nothing ) = simple hasRedundantIf
152- detectionFor (" HasRedundantLambda" , Nothing ) = simple hasRedundantLambda
153- detectionFor (" HasRedundantLocalVariableReturn" , Nothing ) = simple hasRedundantLocalVariableReturn
154- detectionFor (" HasRedundantParameter" , Nothing ) = simple hasRedundantParameter
155- detectionFor (" HasRedundantReduction" , Nothing ) = simple hasRedundantReduction
156- detectionFor (" HasRedundantRepeat" , Nothing ) = simple hasRedundantRepeat
157- detectionFor (" HasTooManyMethods" , Nothing ) = simple hasTooManyMethods
158- detectionFor (" HasTooShortBindings" , Nothing ) = withLanguage hasTooShortIdentifiers
159- detectionFor (" HasTooShortIdentifiers" , Nothing ) = withLanguage hasTooShortIdentifiers
160- detectionFor (" HasUnreachableCode" , Nothing ) = simple hasUnreachableCode
161- detectionFor (" HasUsageTypos" , Just target) = raw (detectUsageTypos target)
162- detectionFor (" HasWrongCaseBinding" , Nothing ) = withLanguage hasWrongCaseIdentifiers
163- detectionFor (" HasWrongCaseIdentifiers" , Nothing ) = withLanguage hasWrongCaseIdentifiers
164- detectionFor (" IsLongCode" , Nothing ) = unsupported
165- detectionFor (" OverridesEqualOrHashButNotBoth" , Nothing ) = simple overridesEqualOrHashButNotBoth
166- detectionFor (" ReturnsNil" , Nothing ) = simple returnsNil
167- detectionFor (" ReturnsNull" , Nothing ) = simple returnsNil
168- detectionFor (" ShouldInvertIfCondition" , Nothing ) = simple shouldInvertIfCondition
169- detectionFor (" ShouldUseOtherwise" , Nothing ) = simple shouldUseOtherwise
170- detectionFor (" ShouldUseStrictComparators" , Nothing ) = simple shouldUseStrictComparators
171- detectionFor (" UsesCut" , Nothing ) = simple usesCut
172- detectionFor (" UsesFail" , Nothing ) = simple usesFail
173- detectionFor (" UsesNamedSelfReference" , Nothing ) = simple usesNamedSelfReference
174- detectionFor (" UsesUnificationOperator" , Nothing ) = simple usesUnificationOperator
175- detectionFor (" JavaScript#UsesVarInsteadOfLet" , Nothing ) = simple usesVarInsteadOfLet
176- detectionFor _ = unsupported
135+ detectionFor (" DiscardsExceptions" , Nothing ) = simple discardsExceptions
136+ detectionFor (" DoesConsolePrint" , Nothing ) = simple doesConsolePrint
137+ detectionFor (" DoesNilTest" , Nothing ) = simple doesNilTest
138+ detectionFor (" DoesNullTest" , Nothing ) = simple doesNilTest
139+ detectionFor (" DoesTypeTest" , Nothing ) = simple doesTypeTest
140+ detectionFor (" HasAssignmentCondition" , Nothing ) = simple hasAssignmentCondition
141+ detectionFor (" HasAssignmentReturn" , Nothing ) = simple hasAssignmentReturn
142+ detectionFor (" HasCodeDuplication" , Nothing ) = unsupported
143+ detectionFor (" HasDeclarationTypos" , Just target) = raw (detectDeclarationTypos target)
144+ detectionFor (" HasEmptyIfBranches" , Nothing ) = simple hasEmptyIfBranches
145+ detectionFor (" HasEmptyRepeat" , Nothing ) = simple hasEmptyRepeat
146+ detectionFor (" HasEqualIfBranches" , Nothing ) = simple hasEqualIfBranches
147+ detectionFor (" HasLongParameterList" , Nothing ) = simple hasLongParameterList
148+ detectionFor (" HasMisspelledBindings" , Nothing ) = withLanguage hasMisspelledIdentifiers
149+ detectionFor (" HasMisspelledIdentifiers" , Nothing ) = withLanguage hasMisspelledIdentifiers
150+ detectionFor (" HasRedundantBooleanComparison" , Nothing ) = simple hasRedundantBooleanComparison
151+ detectionFor (" HasRedundantGuards" , Nothing ) = simple hasRedundantGuards
152+ detectionFor (" HasRedundantIf" , Nothing ) = simple hasRedundantIf
153+ detectionFor (" HasRedundantLambda" , Nothing ) = simple hasRedundantLambda
154+ detectionFor (" HasRedundantLocalVariableReturn" , Nothing ) = simple hasRedundantLocalVariableReturn
155+ detectionFor (" HasRedundantParameter" , Nothing ) = simple hasRedundantParameter
156+ detectionFor (" HasRedundantReduction" , Nothing ) = simple hasRedundantReduction
157+ detectionFor (" HasRedundantRepeat" , Nothing ) = simple hasRedundantRepeat
158+ detectionFor (" HasTooManyMethods" , Nothing ) = simple hasTooManyMethods
159+ detectionFor (" HasTooShortBindings" , Nothing ) = withLanguage hasTooShortIdentifiers
160+ detectionFor (" HasTooShortIdentifiers" , Nothing ) = withLanguage hasTooShortIdentifiers
161+ detectionFor (" HasUnreachableCode" , Nothing ) = simple hasUnreachableCode
162+ detectionFor (" HasUsageTypos" , Just target) = raw (detectUsageTypos target)
163+ detectionFor (" HasWrongCaseBinding" , Nothing ) = withLanguage hasWrongCaseIdentifiers
164+ detectionFor (" HasWrongCaseIdentifiers" , Nothing ) = withLanguage hasWrongCaseIdentifiers
165+ detectionFor (" IsLongCode" , Nothing ) = unsupported
166+ detectionFor (" OverridesEqualOrHashButNotBoth" , Nothing ) = simple overridesEqualOrHashButNotBoth
167+ detectionFor (" ReturnsNil" , Nothing ) = simple returnsNil
168+ detectionFor (" ReturnsNull" , Nothing ) = simple returnsNil
169+ detectionFor (" ShouldInvertIfCondition" , Nothing ) = simple shouldInvertIfCondition
170+ detectionFor (" ShouldUseOtherwise" , Nothing ) = simple shouldUseOtherwise
171+ detectionFor (" ShouldUseStrictComparators" , Nothing ) = simple shouldUseStrictComparators
172+ detectionFor (" UsesCut" , Nothing ) = simple usesCut
173+ detectionFor (" UsesFail" , Nothing ) = simple usesFail
174+ detectionFor (" UsesNamedSelfReference" , Nothing ) = simple usesNamedSelfReference
175+ detectionFor (" UsesUnificationOperator" , Nothing ) = simple usesUnificationOperator
176+ detectionFor (" JavaScript#UsesVarInsteadOfLet" , Nothing ) = simple usesVarInsteadOfLet
177+ detectionFor (" JavaScript#UsesForInInsteadOfForOf" , Nothing ) = simple usesForInInsteadOfForOf
178+ detectionFor _ = unsupported
177179
178180unsupported :: Detection
179181unsupported _ _ = []
0 commit comments