lolibrary/lolibrary

View on GitHub

Showing 54 of 80 total issues

Function exports has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
Severity: Major
Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 50 mins to fix

    Avoid deeply nested control flow statements.
    Open

                if (this.prev < entry.catchLoc) {
                  return handle(entry.catchLoc, true);
                }
    Severity: Major
    Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                } else if (hasFinally) {
                  if (this.prev < entry.finallyLoc) {
                    return handle(entry.finallyLoc);
                  }
      
      
      Severity: Major
      Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 45 mins to fix

        Function exports has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          rawScriptExports,
          compiledTemplate,
          functionalTemplate,
          injectStyles,
          scopeId,
        Severity: Minor
        Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 45 mins to fix

          Function write has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                write: function write(name, value, expires, path, domain, secure) {
          Severity: Minor
          Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 45 mins to fix

            Consider simplifying this complex logical expression.
            Open

              if (moduleIdentifier) { // server build
                hook = function (context) {
                  // 2.3 injection
                  context =
                    context || // cached call
            Severity: Major
            Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if (utils.isFormData(data) ||
                    utils.isArrayBuffer(data) ||
                    utils.isBuffer(data) ||
                    utils.isStream(data) ||
                    utils.isFile(data) ||
              Severity: Major
              Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 40 mins to fix

                Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                module.exports = function createError(message, config, code, request, response) {
                Severity: Minor
                Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 35 mins to fix

                  Method newPivot has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function newPivot(Eloquent $parent, array $attributes, $table, $exists, $using = null)
                  Severity: Minor
                  Found in web.sakura/app/Models/Traits/DateHandling.php - About 35 mins to fix

                    Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    module.exports = function enhanceError(error, config, code, request, response) {
                    Severity: Minor
                    Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 35 mins to fix

                      Function exports has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
                      Severity: Minor
                      Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 35 mins to fix

                        Function update has a Cognitive Complexity of 7 (exceeds 5 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 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function deleteImage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function deleteImage(Item $item, Image $image)
                            {
                                // sanity check first
                                if (! $item->images->contains($image)) {
                                    abort(404);
                        Severity: Minor
                        Found in web.sakura/app/Http/Controllers/Items/ItemController.php - About 35 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function run has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public function run()
                            {
                                foreach (static::$content as $slug => $value) {
                                    if (is_numeric($slug)) {
                                        // if we have a raw array, slug the value instead.
                        Severity: Minor
                        Found in web.sakura/database/seeds/Seeder.php - About 25 mins to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Severity
                        Category
                        Status
                        Source
                        Language