Skip to main content
They are reports, not actual failures.
Source Link
rolfl
  • 98.1k
  • 17
  • 220
  • 419

Some numbers are called 'magic' because it is unclear where they come from. I think in this particular case, it is clear that 100 originates from the definition of percent. However, if you wish you can define a constant PERCENTS_IN_UNIT_RATE=100 instead of using it directly.

Violations fromreported by code analysis tools are really only suggestions and it is okay to disagree with them. If in doubt ask other programmers who work on the same project, or toss a coin and move to the next task! :-)

Some numbers are called 'magic' because it is unclear where they come from. I think in this particular case, it is clear that 100 originates from the definition of percent. However, if you wish you can define a constant PERCENTS_IN_UNIT_RATE=100 instead of using it directly.

Violations from code analysis tools are really only suggestions and it is okay to disagree with them. If in doubt ask other programmers who work on the same project, or toss a coin and move to the next task! :-)

Some numbers are called 'magic' because it is unclear where they come from. I think in this particular case, it is clear that 100 originates from the definition of percent. However, if you wish you can define a constant PERCENTS_IN_UNIT_RATE=100 instead of using it directly.

Violations reported by code analysis tools are really only suggestions and it is okay to disagree with them. If in doubt ask other programmers who work on the same project, or toss a coin and move to the next task! :-)

added some formatting
Source Link
Malachi
  • 29.1k
  • 11
  • 87
  • 188

Some numbers are called 'magic' because it is unclear where they come from. I think in this particular case, it is clear that 100 originates from the definition of percent. However, if you wish you can define a constant PERCENTS_IN_UNIT_RATE=100PERCENTS_IN_UNIT_RATE=100 instead of using it directly.

Violations from code analysis tools are really only suggestions and it is OKokay to disagree with them. If in doubt ask other programmers who work on the same project, or toss a coin and move to the next task! :-)

Some numbers are called 'magic' because it is unclear where they come from. I think in this particular case, it is clear that 100 originates from the definition of percent. However, if you wish you can define a constant PERCENTS_IN_UNIT_RATE=100 instead of using it directly.

Violations from code analysis tools are really only suggestions and it is OK to disagree with them. If in doubt ask other programmers who work on the same project, or toss a coin and move to the next task! :-)

Some numbers are called 'magic' because it is unclear where they come from. I think in this particular case, it is clear that 100 originates from the definition of percent. However, if you wish you can define a constant PERCENTS_IN_UNIT_RATE=100 instead of using it directly.

Violations from code analysis tools are really only suggestions and it is okay to disagree with them. If in doubt ask other programmers who work on the same project, or toss a coin and move to the next task! :-)

Source Link
mkalkov
  • 1.1k
  • 1
  • 8
  • 10

Some numbers are called 'magic' because it is unclear where they come from. I think in this particular case, it is clear that 100 originates from the definition of percent. However, if you wish you can define a constant PERCENTS_IN_UNIT_RATE=100 instead of using it directly.

Violations from code analysis tools are really only suggestions and it is OK to disagree with them. If in doubt ask other programmers who work on the same project, or toss a coin and move to the next task! :-)