lolibrary/lolibrary

View on GitHub

Showing 80 of 80 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        Schema::create('jobs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('queue');
            $table->longText('payload');
            $table->tinyInteger('attempts')->unsigned();
Severity: Major
Found in web.sakura/database/migrations/0018____create_jobs_table.php and 1 other location - About 2 hrs to fix
web.sakura/database/migrations/0032____fix_jobs_table.php on lines 40..50

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        Schema::create('jobs', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('queue');
            $table->longText('payload');
            $table->tinyInteger('attempts')->unsigned();
Severity: Major
Found in web.sakura/database/migrations/0032____fix_jobs_table.php and 1 other location - About 2 hrs to fix
web.sakura/database/migrations/0018____create_jobs_table.php on lines 16..26

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 124.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function makeInvokeMethod has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function makeInvokeMethod(innerFn, self, context) {
    var state = GenStateSuspendedStart;

    return function invoke(method, arg) {
      if (state === GenStateExecuting) {
Severity: Major
Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 2 hrs to fix

    Function invoke has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        return function invoke(method, arg) {
          if (state === GenStateExecuting) {
            throw new Error("Generator is already running");
          }
    
    
    Severity: Minor
    Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 2 hrs to fix

      Method update has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function update(ItemUpdateRequest $request, Item $item)
          {
              /** @var \App\Models\User $user */
              $user = auth()->user();
              if ($item->published()) {
      Severity: Minor
      Found in web.sakura/app/Http/Controllers/Items/ItemController.php - About 1 hr to fix

        Function exports has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function () {
          var head, last, notify;
        
          var flush = function () {
            var parent, fn;
        Severity: Minor
        Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

          Function exports has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
            $iterCreate(Constructor, NAME, next);
            var getMethod = function (kind) {
              if (!BUGGY && kind in proto) return proto[kind];
              switch (kind) {
          Severity: Minor
          Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

            Function maybeInvokeDelegate has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function maybeInvokeDelegate(delegate, context) {
                var method = delegate.iterator[context.method];
                if (method === undefined) {
                  // A .throw or .return when the delegate iterator has no .throw
                  // method always terminates the yield* loop.
            Severity: Minor
            Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

              Method store has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function store(ItemStoreRequest $request)
                  {
                      DB::transaction(function () use ($request) {
                          $brand = Brand::findOrFail($request->brand);
                          $category = Category::findOrFail($request->category);
              Severity: Minor
              Found in web.sakura/app/Http/Controllers/Items/ItemController.php - About 1 hr to fix

                Function notify has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var notify = function (promise, isReject) {
                  if (promise._n) return;
                  promise._n = true;
                  var chain = promise._c;
                  microtask(function () {
                Severity: Minor
                Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

                  Function dispatchRequest has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function dispatchRequest(config) {
                    throwIfCancellationRequested(config);
                  
                    // Support baseURL config
                    if (config.baseURL && !isAbsoluteURL(config.url)) {
                  Severity: Minor
                  Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

                    Function dispatchException has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        dispatchException: function(exception) {
                          if (this.done) {
                            throw exception;
                          }
                    
                    
                    Severity: Minor
                    Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

                      Function main has 67 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

                      func main() {
                          g := generator.New()
                      
                          t, err := template.New("protoc-gen-router").Parse(tmpl)
                          if err != nil {
                      Severity: Minor
                      Found in cmd/protoc-gen-router/main.go - About 1 hr to fix

                        Function render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var render = function() {
                          var _vm = this
                          var _h = _vm.$createElement
                          var _c = _vm._self._c || _h
                          return _c(
                        Severity: Minor
                        Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

                          Function AsyncIterator has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function AsyncIterator(generator) {
                              function invoke(method, arg, resolve, reject) {
                                var record = tryCatch(generator[method], generator, arg);
                                if (record.type === "throw") {
                                  reject(record.arg);
                          Severity: Minor
                          Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

                            Function $export has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            var $export = function (type, name, source) {
                              var IS_FORCED = type & $export.F;
                              var IS_GLOBAL = type & $export.G;
                              var IS_STATIC = type & $export.S;
                              var IS_PROTO = type & $export.P;
                            Severity: Minor
                            Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

                              Function clearSelectedFilters has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  clearSelectedFilters: function () {
                                    var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(lens) {
                                      var _updateQueryString;
                              
                                      return _regenerator2.default.wrap(function _callee$(_context) {
                              Severity: Minor
                              Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

                                Method apply has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function apply(Request $request, $query, $value)
                                    {
                                        // lock away certain functions behind dev.
                                        if ($request->user()->developer()) {
                                            switch ($value) {
                                Severity: Minor
                                Found in web.sakura/app/Nova/Filters/ItemStatusFilter.php - About 1 hr to fix

                                  Function buildURL has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  module.exports = function buildURL(url, params, paramsSerializer) {
                                    /*eslint no-param-reassign:0*/
                                    if (!params) {
                                      return url;
                                    }
                                  Severity: Minor
                                  Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 hr to fix

                                    Method fields has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function fields(Request $request)
                                        {
                                            return [
                                                Gravatar::make(),
                                    
                                    
                                    Severity: Minor
                                    Found in web.sakura/app/Nova/User.php - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language