Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A command–line utility for refactoring planning. It uses .rubocop_todo.yml
and git history to prioritize a list of refactorings that can bring the most value.
Prerequisites:
git
repo;.rubocop_todo.yml
.Install the gem and add to the application's Gemfile by executing:
$ bundle add rubocop_director
First of all, create the initial config file based on .rubocop_todo.yml
:
bundle exec rubocop-director --generate-config
Optionally adjust weights in the config:
update_weight
means how important the fact that file was recently updated;default_cop_weight
will be used in case when weight for a specific cop is not set;weights
contains weights for specific cops.You can use any numbers you want, but I think it's better to stick with something from 0 to 1.
Build the report:
bundle exec rubocop-director
As a result you'll get something like this:
💡 Checking git history since 1995-01-01 to find hot files...
💡🎥 Running rubocop to get the list of offences to fix...
💡🎥🎬 Calculating a list of files to refactor...
Path: app/controllers/user_controller.rb
Updated 99 times since 2023-01-01
Offenses:
🚓 Rails/SomeCop - 2
Refactoring value: 1.5431217598108933 (54.79575%)
Path: app/models/user.rb
Updated 136 times since 2023-01-01
Offenses:
🚓 Rails/SomeCop - 1
🚓 Rails/AnotherCop - 1
Refactoring value: 1.2730122208719792 (45.20425%)
Want a different output format (e.g., CSV)? Let me know, open an issue!
Value is calculated using a formula: sum of value from each cop (<count of offences> * <cop weight> * (<count of file updates> / <total count of updates>) ** <update weight>)
.
If you need to count updates from a specific date—use --since
:
bundle exec rubocop-director --since=2023-01-01
After checking out the repo, run bundle install
to install dependencies
Bug reports and pull requests are welcome on GitHub at https://github.com/DmitryTsepelev/rubocop_director.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that rubocop_director demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.