fizzbuzz-kata's People
fizzbuzz-kata's Issues
Difficult to follow the logic
https://github.com/yotaken/FizzBuzz-Kata/blob/master/fizz-buzz/src/FizzBuzz.php#L124
Como se va sobreescribiendo todo $numbers estás dando la posibilidad de hacer lo que quieran dentro de un método, por lo que es super sencillo que un método futuro te estropee todo, además de ser muy difícil de saber qué hace cada método.
No se han revisado los tests al haber cambio de requisitos
https://github.com/yotaken/FizzBuzz-Kata/blob/master/fizz-buzz/test/FizzBuzzTest.php#L50
El test no es verdad every_third_number_is_fizz (ni si quiera como está implementado, porque hay dos condiciones) pero tampoco cuando se ha añadido la regla de contiene 3 y/o 5.
https://github.com/yotaken/FizzBuzz-Kata/blob/master/fizz-buzz/test/FizzBuzzTest.php#L54
Mixed rules
https://github.com/yotaken/FizzBuzz-Kata/blob/master/fizz-buzz/src/FizzBuzz.php#L86
El método setFizzIfNumberContainsThree comprueba que no sea divisible por tres o por cinco, que es otra regla.
Por la forma en que está el bucle principal es necesario, pero nos indica que no es una buena estrategia sobreescribir siempre $numbers[$i] cuando se cumple otra regla.
Orden de los métodos no óptima
Desde mi punto de vista los métodos públicos deberían estar por encima de los protected y los privados.
https://github.com/yotaken/FizzBuzz-Kata/blob/master/fizz-buzz/src/FizzBuzz.php#L124
Además, debería ser fácil ir leyendo lo que sucede sin tener que hacer muchos saltos arriba abajo. Debería ser posible leerlo casi como si fuera un libro.
Los bucles en tests unitarios suelen ser un mal síntoma
Son más frágiles y suelen estar muy acoplados a la implementación.
https://github.com/yotaken/FizzBuzz-Kata/blob/master/fizz-buzz/test/FizzBuzzTest.php#L53-L55
Input output parameters are a bad smell
https://github.com/yotaken/FizzBuzz-Kata/blob/master/fizz-buzz/src/FizzBuzz.php#L30
$numbers es I/O argument y además es devuelto.
Remove unused code
No baby steps
El hecho de sólo tener un test que comprueba números
https://github.com/yotaken/FizzBuzz-Kata/blob/master/fizz-buzz/test/FizzBuzzTest.php#L20
indica que no se han hecho baby steps.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.