Coder Social home page Coder Social logo

registry's Introduction

The Laravel Packages Registry

Packages registry for the Laravel framework.

Technologies

Packages and components

  • PHP dependencies are managed via Composer
  • Front-end packages are managed with Bower

registry's People

Contributors

anahkiasen avatar janhartigan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

registry's Issues

Website displays a Laravel error page if I try to log in using Github.

ErrorException: array_replace_recursive(): Argument #2 is not an array

27. ErrorException – …/­vendor/­anahkiasen/­arrounded/­src/­Arrounded/­Traits/­JsonAttributes.php43
26. Illuminate\Exception\Handler handleError  – <#unknown>0
25. array_replace_recursive – …/­vendor/­anahkiasen/­arrounded/­src/­Arrounded/­Traits/­JsonAttributes.php43
24. Registry\Abstracts\AbstractModel getJsonAttribute – …/­bootstrap/­compiled.php10721
23. Registry\Maintainer getColumnsAttribute – …/­bootstrap/­compiled.php6682
22. Illuminate\Database\Eloquent\Model mutateAttribute – …/­bootstrap/­compiled.php6654
21. Illuminate\Database\Eloquent\Model getAttributeValue – …/­bootstrap/­compiled.php6640
20. Illuminate\Database\Eloquent\Model getAttribute – …/­bootstrap/­compiled.php6840
19. Illuminate\Database\Eloquent\Model __get – …/­app/­composers.php8
18. {closure} – <#unknown>0
17. call_user_func_array – …/­bootstrap/­compiled.php5734
16. Illuminate\Events\Dispatcher fire – …/­bootstrap/­compiled.php8942
15. Illuminate\View\Environment callComposer – …/­bootstrap/­compiled.php9259
14. Illuminate\View\View renderContents – …/­bootstrap/­compiled.php9251
13. Illuminate\View\View render – …/­bootstrap/­compiled.php9942
12. Illuminate\Http\Response setContent – …/­bootstrap/­compiled.php9481
11. Symfony\Component\HttpFoundation\Response __construct – …/­bootstrap/­compiled.php4791
10. Illuminate\Routing\Router prepareResponse – …/­bootstrap/­compiled.php4623
9. Illuminate\Routing\Router dispatchToRoute – …/­bootstrap/­compiled.php4609
8. Illuminate\Routing\Router dispatch – …/­bootstrap/­compiled.php680
7. Illuminate\Foundation\Application dispatch – …/­bootstrap/­compiled.php661
6. Illuminate\Foundation\Application handle – …/­bootstrap/­compiled.php1104
5. Illuminate\Http\FrameGuard handle – …/­bootstrap/­compiled.php7129
4. Illuminate\Session\Middleware handle – …/­bootstrap/­compiled.php7730
3. Illuminate\Cookie\Queue handle – …/­bootstrap/­compiled.php7677
2. Illuminate\Cookie\Guard handle – …/­bootstrap/­compiled.php10671
1. Stack\StackedHttpKernel handle – …/­bootstrap/­compiled.php622
0. Illuminate\Foundation\Application run – …/­public/­index.php49

On Popularity...

I've been noticing that the "popularity" number fluctuates pretty wildly from time to time and I decided to take a look at exactly how you're calculating that. I found this method:

https://github.com/Anahkiasen/registry/blob/master/app/Registry/Services/IndexesComputer.php#L32-L52

This currently looks like this:

/**
 * Compute every package's popularity
 *
 * @return void
 */
public function computePopularity()
{
    $this->computeIndexes('popularity', array(
        'downloads_total' => 1.25,
        'watchers'        => 2,
        'forks'           => 0.75,
        'favorites'       => 0.25,
        'freshness'       => 0.75,
    ), array(
        'downloads_total' => 'downloads_total',
        'watchers'        => 'watchers',
        'forks'           => 'forks',
        'favorites'       => 'favorites',
        'freshness'       => 'freshness',
    ));
}

What strikes me as a bit odd is that you're weighting watchers at 2 but there doesn't seem to be anything checking the stars. IMO, stars are a better indicator of the popularity of a repo because they are explicitly for "favoriting" something without the hassle of getting constant updates about that repo.

In addition to that, I'm not sure I would even given the packagist "favorites" any weight since that site is kind of a disaster. Seems kind of like stars, total downloads, and forks should be the primary determinants of popularity. And then if you want to gauge "freshness", it should probably be based on recent downloads instead of recent repository updates (which is how I think you're doing it). "Freshness" as it pertains to popularity is probably more meaningful that way, especially considering you're already factoring that "freshness" into the "trust" metric.

Curious to hear what you think...

Division by zero

When trying to view my profile or all maintainers, I get a division by zero error caused by the following:

$popularity = $this->packages->lists('popularity');
$popularity = array_sum($popularity) / sizeof($popularity);
$popularity = round($popularity, 2);
return $popularity;

Easy fix:

$popularity = $this->packages->lists('popularity');
if (!empty($popularity)) {
    $popularity = array_sum($popularity) / sizeof($popularity);
    $popularity = round($popularity, 2);
} else {
    $popularity = 0;
}

return $popularity;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.