https://github.com/sc0v0ne/method_refactoring_change_function_declaration
This code aims to use the 'Change Function Declaration' refactoring method. Simple code to understand the method.
https://github.com/sc0v0ne/method_refactoring_change_function_declaration
college faculdade-metodista-granbery fmg granbery martin-fowler-book pytest python python-3 refactoring
Last synced: 10 months ago
JSON representation
This code aims to use the 'Change Function Declaration' refactoring method. Simple code to understand the method.
- Host: GitHub
- URL: https://github.com/sc0v0ne/method_refactoring_change_function_declaration
- Owner: sc0v0ne
- Created: 2022-04-29T13:28:10.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-04-30T12:43:47.000Z (over 3 years ago)
- Last Synced: 2025-02-17T14:47:41.410Z (10 months ago)
- Topics: college, faculdade-metodista-granbery, fmg, granbery, martin-fowler-book, pytest, python, python-3, refactoring
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Change Function Declaration
🎓 College: [Faculdade Metodista Granbery](http://granbery.edu.br/)
👨🏫 Teacher: [Marco Antônio - Github](https://github.com/marcoaparaujo) | [Linkedin](https://www.linkedin.com/in/marco-ant%C3%B4nio-ara%C3%BAjo/)
📗 Book: [Refatoração - Aperfeiçoando o design de códigos existentes - Martin Fowler](https://www.amazon.com/-/pt/dp/B087N8LKYB/ref=sr_1_1?__mk_pt_BR=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=M4T29CCKD30E&keywords=refatora%C3%A7%C3%A3o&qid=1651322207&sprefix=refatora%C3%A7%C3%A3o%2Caps%2C203&sr=8-1)
Esse código tem como objetivo utilizar o método de refatoração 'Change Function Declaration'. Código simples para poder entender o método.
This code aims to use the 'Change Function Declaration' refactoring method. Simple code to understand the method.
## Simple Method
Nesse código utilizei o procedimento simples. De acordo com livro, que está referenciado logo acima, você deve seguir esse passos:
- Se você estiver removendo um parâmetro, certifique-se de que ele não seja referenciado no corpo da função.
- Altere a declaração do método para a declaração desejada.
- Encontre todas as referências à declaração antiga do método e atualize-as com a nova chamada.
- Teste.
In this code I used the simple procedure. According to the book, which is referenced just above, you must follow these steps:
- If you are removing a parameter, make sure it is not referenced in the function body.
- Change the method declaration to the desired declaration.
- Find all references to the old method declaration and update them with the new call.
- Test.
Para visualizar o código da refatoração você deve clicar na aba de branches, uma branch está sem refatoração a ou está com refatoração.
To view the refactoring code you must click on the branches tab, a branch is not refactored or is refactored.