{"action":"created","issue":{"url":"https://api.github.com/repos/dataproofer/core-suite/issues/6","repository_url":"https://api.github.com/repos/dataproofer/core-suite","labels_url":"https://api.github.com/repos/dataproofer/core-suite/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/dataproofer/core-suite/issues/6/comments","events_url":"https://api.github.com/repos/dataproofer/core-suite/issues/6/events","html_url":"https://github.com/dataproofer/core-suite/issues/6","id":144662710,"number":6,"title":"Max-integer-value check too specific","user":{"login":"myersjustinc","id":764865,"avatar_url":"https://avatars.githubusercontent.com/u/764865?v=3","gravatar_id":"","url":"https://api.github.com/users/myersjustinc","html_url":"https://github.com/myersjustinc","followers_url":"https://api.github.com/users/myersjustinc/followers","following_url":"https://api.github.com/users/myersjustinc/following{/other_user}","gists_url":"https://api.github.com/users/myersjustinc/gists{/gist_id}","starred_url":"https://api.github.com/users/myersjustinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myersjustinc/subscriptions","organizations_url":"https://api.github.com/users/myersjustinc/orgs","repos_url":"https://api.github.com/users/myersjustinc/repos","events_url":"https://api.github.com/users/myersjustinc/events{/privacy}","received_events_url":"https://api.github.com/users/myersjustinc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-30T17:37:14Z","updated_at":"2016-03-30T22:52:37Z","closed_at":null,"body":"I'm a big fan of the idea of checking for suspicious integer values, but [the one currently provided][current-check] is very specific and not one I've encountered in other software packages.\r\n\r\nThis isn't to say your number's wrong, of course—clearly it's bitten you in the past—but I'd like to suggest adding a few other values that have caused issues for me. My main suggestion would be to add **2,147,483,647**.\r\n\r\n## Expected values ##\r\n\r\n[The MySQL docs][mysql] docs list the values I'm more accustomed to:\r\n\r\n|Type     |Storage (Bytes)|Minimum Value (Signed/Unsigned)|Maximum Value (Signed/Unsigned)|\r\n|---------|---------------|-------------------------------|-------------------------------|\r\n|TINYINT  |1              |-128                           |127                            |\r\n|         |               |0                              |255                            |\r\n|SMALLINT |2              |-32768                         |32767                          |\r\n|         |               |0                              |65535                          |\r\n|MEDIUMINT|3              |-8388608                       |8388607                        |\r\n|         |               |0                              |16777215                       |\r\n|INT      |4              |-2147483648                    |2147483647                     |\r\n|         |               |0                              |4294967295                     |\r\n|BIGINT   |8              |-9223372036854775808           |9223372036854775807            |\r\n|         |               |0                              |18446744073709551615           |\r\n\r\nIn particular, you might recognize values like:\r\n\r\n*   **65,535**: max unsigned value for a `SMALLINT`, which is one less than the [Excel row cutoff][excel-rows] (since counting from 0 to 65,535 gives you 65,536 rows)\r\n\r\n*   **16,777,215**: max unsigned value for a `MEDIUMINT`, which is the maximum number of colors in eight-bit RGB (eight bits each for red, green and blue), and why you'll hear references to \"[16 million colors][16-million]\"\r\n\r\n*   **2,147,483,647**: the one I'm most used to, because it's the max signed value for an `INT`, and rose to fame a year or two back when Gangnam Style [maxed out Google's 32-bit signed view counter][gangnam-style].\r\n\r\n(If you're more of a Postgres fan, [their docs][postgresql] list some of the same values.)\r\n\r\n## Theory ##\r\n\r\nThese maximum values tend to appear because their binary representations are:\r\n\r\n*   all ones, for the maximum value of an unsigned integer (only zero or positive), such as 65,535, which is `1111 1111 1111 1111`\r\n\r\n*   a zero followed by all ones, for the maximum value of a signed integer (can be zero, positive or negative), such as 32,767, which is `0111 1111 1111 1111`, or 2,147,483,647, which is `0111 1111 1111 1111 1111 1111 1111 1111`\r\n\r\n*   a one followed by all zeroes for the minimum (i.e., most negative) value of a signed integer, such as -32,768, which has a [two's complement][twos-complement] representation of `1000 0000 0000 0000`\r\n\r\nThese mostly apply for binary values with some multiple of eight bits (i.e., an integral number of bytes), such as my 16-bit examples (and one 32-bit example) here.\r\n\r\n## Concern ##\r\n\r\nThe [current check][current-check] for a value of 2,097,152 is an interesting one because it _doesn't_ hit a nice, round number of bytes: `10 0000 0000 0000 0000 0000` doesn't seem to meet these conditions.\r\n\r\nAgain, this isn't to say it's not a problematic value—clearly it has been for you—but I'd argue the values above (in particular **2,147,483,647**, as the default max signed integer value for both MySQL and Postgres) are more likely to suggest problems for other users.\r\n\r\n## Implementation ##\r\n\r\nI'm happy to add a few more hardcoded values in a PR if you'd like, but I figured I'd start the conversation first in case there are other values people would like to suggest.\r\n\r\n[16-million]: http://gizmodo.com/all-16-million-colors-of-the-rgb-spectrum-are-in-these-1330219443\r\n[current-check]: https://github.com/dataproofer/core-suite/blob/764d1d19e492eb29c79bf8f1c6a740246d2cf585/src/integerEquals2097152.js#L29\r\n[excel-rows]: https://github.com/dataproofer/core-suite/blob/764d1d19e492eb29c79bf8f1c6a740246d2cf585/src/numberOfRowsIs65k.js\r\n[gangnam-style]: http://edition.cnn.com/2014/12/03/showbiz/gangnam-style-youtube/index.html?hpt=hp_t4\r\n[mysql]: https://dev.mysql.com/doc/refman/5.7/en/integer-types.html\r\n[postgresql]: http://www.postgresql.org/docs/9.5/interactive/datatype-numeric.html#DATATYPE-NUMERIC-TABLE\r\n[twos-complement]: https://en.wikipedia.org/wiki/Two%27s_complement"},"comment":{"url":"https://api.github.com/repos/dataproofer/core-suite/issues/comments/203672815","html_url":"https://github.com/dataproofer/core-suite/issues/6#issuecomment-203672815","issue_url":"https://api.github.com/repos/dataproofer/core-suite/issues/6","id":203672815,"user":{"login":"geraldarthur","id":1578563,"avatar_url":"https://avatars.githubusercontent.com/u/1578563?v=3","gravatar_id":"","url":"https://api.github.com/users/geraldarthur","html_url":"https://github.com/geraldarthur","followers_url":"https://api.github.com/users/geraldarthur/followers","following_url":"https://api.github.com/users/geraldarthur/following{/other_user}","gists_url":"https://api.github.com/users/geraldarthur/gists{/gist_id}","starred_url":"https://api.github.com/users/geraldarthur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geraldarthur/subscriptions","organizations_url":"https://api.github.com/users/geraldarthur/orgs","repos_url":"https://api.github.com/users/geraldarthur/repos","events_url":"https://api.github.com/users/geraldarthur/events{/privacy}","received_events_url":"https://api.github.com/users/geraldarthur/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T22:52:37Z","updated_at":"2016-03-30T22:52:37Z","body":"Interesting, and you're right. The current app couldn't catch that bug. However, we're just barely starting to discuss where we grow the Dataproofer project from here. Happy to talk more if you think there's a need.\r\n\r\nFor now, creating copies of tests is exactly how we do it. It's relatively simple for newer coders, but (hopefully) quick and easy for more experienced folks like yourself. Thanks again for your time!"}}