Antipatterns

Test hungry score

This feature currently assigns a score of test hungriness to methods. How test hungry sore is calculated? Test hungry score calculates on 2 parameters such as Complexity and Network Size. The score is calculated as Complexity * Network Size.The complexity of a function means how many if/else are present in…

0
Read More

Direct Cyclic Dependency

A direct dependency is formed when two classes or files have dependency over each other. The dependency can be caused by using variables or function calls. Impact Cyclic dependency creates tight coupling between these classes and it is hard to reuse as separate units. Sometimes, circular dependency may cause memory…

0
Read More

File Coupling

When one file is coupled or dependent on many other files, it is called as file coupling. The dependency can be in the form of variables or functions. This applies to only those file-level variables or functions. Impact Higher coupling with other files makes the code fragile. This is because…

0
Read More

Nested Function

A function with nested inner functions and a depth of more than 3 levels is a Nested function. Impact A heavily nested function makes it bulky and complex to read and maintain. Time and maintenance cost increases. Possibility of duplication of function increases. Characteristics A function has multiple inner functions…

0
Read More

Monster File

Monster file single-handedly implements large blocks of functionality within a system and performs multiple, non-cohesive functionalities. It violates the basic approach of structured programming which is: Break a big problem into smaller problems and then resolve these problems. The result obtained inevitably solves the big problem. The monster file typically…

0
Read More

Nested Closure

A closure having nested closures with the depth of more than 2 levels is less readable, slower in performance and hold excessively large private memory causing memory leaks. Impact A heavily nested closure is complex to read and maintain. Creating closures inside other closure leads to duplication in memory, potentially…

0
Read More

Dispersed Variable Decl In Func (DVD)

Variable Hoisting :  Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope before code execution. This means that no matter where functions and variables are declared, they are moved to the top of their scope regardless of whether their scope is…

0
Read More

Promise Anomaly (PA) Beta

A promise is an object which can be returned synchronously from an asynchronous function. Every promise executor function should call resolve and reject function. Impact If any of the executer functions are not called, promise will not be settled and remains in its pending state. Any .then() or .catch() listeners…

0
Read More

Markup in JS (MJS)

Markup in Javascript is used to insert HTML elements in javascript. Impact Creating HTML elements in JS will decrease the readability & maintainability of code affecting reusability as well. This will break the basic principle i.e. separation of presentation and business logic. This will also lead to high memory consumption…

0
Read More

Test Hungry

Test hungry methods demand a high amount of unit/integration tests in order to cover all the execution paths, and this is especially important given the high usage of these methods. Impact Since many other methods or functions are dependent on test hungry methods, a change to this method will have…

0
Read More