Comments (4)
@Asera thank for suggestion :)
To be honest I was thinking about this feature from beginning. With many things I agree. About 1 group:
And what do you think about constants that are not in you project but they are as your dependency(in your vendor).
About second one yes it is practically impossible. But I think there are numbers where we could probable hint. For example: 404 -> HTTP_NOT_FOUND, 200 -> HTTP_OK and all other http response codes. Or 3306 -> MYSQL_PORT and so on.
from phpmnd.
First group
I think all the constants that can be extracted from user source files including vendor folder must be indexed.
Also PHP itself has some constants and I saw some cases when magic numbers were PHP predefined constants.
Second group
We could make hints for common and widespread numbers. I was thinking about custom user dictionary for magic numbers, but i found it useless as all the constants are already included in project files. And if user needs dictionary he can define constants in his project, this will be the best solution.
from phpmnd.
I dont think so that vendor should be included. Firstly it would increase analysis time dramatically. Secondly it is very hard to determine is the constant was found in direct dependency.
from phpmnd.
from phpmnd.
Related Issues (20)
- Update Composer To Support Latest Version of php-timer HOT 3
- Any plans to provide this functionality as part of other general static analysers? HOT 1
- Syntax error when using class called `Match` in the code HOT 6
- Dependency phpunit/php-timer HOT 4
- PHP 8 HOT 14
- New release needed ! HOT 2
- Cache failure in CI HOT 3
- Extension support for Exceptions possible? HOT 4
- What is "12" in Printer\XML ? HOT 5
- New phpunit schema HOT 2
- Option to disable the highlighter
- Ignore line or array specific key declaration HOT 7
- Support github action output format HOT 1
- Add ncurses dependency or test tput availability HOT 4
- New release HOT 4
- tput binary not found in alpine based images HOT 2
- Version 3.0 still renders version 2.5 HOT 8
- How to define the most strict configuration possible for phpmnd ? HOT 1
- phpunit/php-timer v6 support? HOT 2
- [Question] Which output formats are available? HOT 2
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.
from phpmnd.