Giter Club home page Giter Club logo

u235pro_aave_similarity_analysis's Introduction

U235Pro_AAVE_Similarity_Analysis

Purpose

The primary objective of this analysis is to assess the code similarity between the a sub-folder of the source repo and the target repo.

Our engineering team has embarked on a detailed direct comparison of the code repositories. This examination aims to accurately quantify and understand the extent of similarity.

Our analysis result can be found in the conclusion.

Code Repos

Source

Target

A copy of the codes has also been cloned into source_code/ and target_code/ for reference. The .git has been removed for both.

Conclusion

Based on our comparison, we conclude that the source is a subset of the target with approximately 7156 loc reduction.

Target has gone through multiple rounds of security audits. Prior security assessments on target repos can be a good reference. Readers of this analysis, based on your security requirements, should determine on their own whether or not to directly trust the prior or existing security assessments or audits on target repos.

Methodology for Similarity Comparison

We utilized two tools for the similarity analysis:

  1. git diff --numstat: https://git-scm.com/docs/git-diff
  2. cloc: https://github.com/AlDanial/cloc

Comparison Detail

git diff output

git diff source_code/contracts-internal/contracts-internal/ target_code/aave-v3-core/ --numstat | grep .sol > results/git_diff.txt

output: results/git_diff.txt

cloc output

cloc --not-match-f="(example|test|tests|mock|Mock)" --exclude-dir=mock,mocks,test,debug,template,open-zeppelin,lib,dependencies,interfaces --include-ext=sol --diff target_code/aave-v3-core source_code/contracts-internal/contracts-internal > results/cloc_diff_concise.txt

output: results/cloc_diff_concise.txt

github.com/AlDanial/cloc v 1.98  T=0.17 s (355.5 files/s, 65858.5 lines/s)
-------------------------------------------------------------------------------
Language                     files          blank        comment           code
-------------------------------------------------------------------------------
Solidity
 same                            0              0              0              0
 modified                        0              0              0              0
 added                           1              1              2              6
 removed                        58           1284           2482           7156
-------------------------------------------------------------------------------
SUM:
 same                            0              0              0              0
 modified                        0              0              0              0
 added                           1              1              2              6
 removed                        58           1284           2482           7156
-------------------------------------------------------------------------------

We see about 7156 lines of code removed.

Get a more detailed result:

cloc --by-file --not-match-f="(example|test|tests|mock|Mock)" --exclude-dir=mock,mocks,test,debug,template,open-zeppelin,lib,dependencies,interfaces --include-ext=sol --diff target_code/aave-v3-core source_code/contracts-internal/contracts-internal > results/cloc_diff.txt

output: results/cloc_diff.txt

u235pro_aave_similarity_analysis's People

Contributors

alansecure3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.