A processor implemented method for inferencing logic out of an application source code, the method comprising: providing, via a user interface, the application source code as an input; parsing, via one or more hardware processors, the application source code using parsers, wherein the parsing results in generation of a code language independent repository, wherein the code language independent repository comprises information about the application source code, wherein the parsers scan each character in the application source code and wherein the code language independent repository comprises information about the application source code, the information comprising at least one of flow, dependencies and structural aspects of the application source code; linking, via the one or more hardware processors, the information related to each other present in the code language independent repository to extract a plurality of logical blocks, wherein the plurality of logical blocks comprising a plurality of leaf nodes, scope till a root node of the logical block and sequential distances between each nodes of the plurality of leaf nodes, wherein the plurality of logical blocks comprising of one or more of a plurality of logically linked code statements results in defining data blocks, control blocks and condition blocks, wherein the size of the plurality of logical blocks is determined through a set of threshold; converting, via the one or more hardware processors, the logical block arranged in form of a hierarchical structure into one or more consumable vectors; creating, via the one or more hardware processors, a plurality of capsules for each pair of the plurality of leaf nodes from the plurality of logical blocks based on the scope of the leaf nodes and sequential distance between the leaf nodes of each pair of the plurality of leaf nodes, wherein the plurality of capsules comprises one or more of leaf node sub-capsules, a plurality of path sub-capsules, and a plurality of sequential distance sub-capsules; calculating, via the one or more hardware processors, an optimized set of hyper parameters of a machine learning model using an optimizer model; training, via the one or more hardware processors, the machine learning model using the calculated hyper parameters; predicting, via the one or more hardware processors, the functionality of the plurality of logical blocks by vectorizing the plurality of logical blocks using the plurality of capsules and the trained machine learning model; and merging, via the one or more hardware processors, the predicted functionality with a plurality of external inputs to determine code logic inference of the application source code. providing, via a user interface, the application source code as an input; parsing, via one or more hardware processors, the application source code using parsers, wherein the parsing results in generation of a code language independent repository, wherein the code language independent repository comprises information about the application source code, wherein the parsers scan each character in the application source code and wherein the code language independent repository comprises information about the application source code, the information comprising at least one of flow, dependencies and structural aspects of the application source code; linking, via the one or more hardware processors, the information related to each other present in the code language independent repository to extract a plurality of logical blocks, wherein the plurality of logical blocks comprising a plurality of leaf nodes, scope till a root node of the logical block and sequential distances between each nodes of the plurality of leaf nodes, wherein the plurality of logical blocks comprising of one or more of a plurality of logically linked code statements results in defining data blocks, control blocks and condition blocks, wherein the size of the plurality of logical blocks is determined through a set of threshold; converting, via the one or more hardware processors, the logical block arranged in form of a hierarchical structure into one or more consumable vectors; creating, via the one or more hardware processors, a plurality of capsules for each pair of the plurality of leaf nodes from the plurality of logical blocks based on the scope of the leaf nodes and sequential distance between the leaf nodes of each pair of the plurality of leaf nodes, wherein the plurality of capsules comprises one or more of leaf node sub-capsules, a plurality of path sub-capsules, and a plurality of sequential distance sub-capsules; calculating, via the one or more hardware processors, an optimized set of hyper parameters of a machine learning model using an optimizer model; training, via the one or more hardware processors, the machine learning model using the calculated hyper parameters; predicting, via the one or more hardware processors, the functionality of the plurality of logical blocks by vectorizing the plurality of logical blocks using the plurality of capsules and the trained machine learning model; and merging, via the one or more hardware processors, the predicted functionality with a plurality of external inputs to determine code logic inference of the application source code.