lolibrary/lolibrary

View on GitHub

Showing 54 of 80 total issues

File field.js has 5482 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/******/ (function(modules) { // webpackBootstrap
/******/     // The module cache
/******/     var installedModules = {};
/******/
/******/     // The require function
Severity: Major
Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 2 wks to fix

    Function Form has 201 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var Form = function () {
        /**
         * Create a new Form instance.
         *
         * @param {object} data
    Severity: Major
    Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 1 day to fix

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

          public function fields(Request $request)
          {
              return [
                  Text::make('ID')->onlyOnDetail(),
                  Text::make('Slug')->onlyOnDetail(),
      Severity: Major
      Found in web.sakura/app/Nova/Item.php - About 4 hrs to fix

        Function main has a Cognitive Complexity of 44 (exceeds 20 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 4 hrs 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 xhrAdapter has 106 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function xhrAdapter(config) {
          return new Promise(function dispatchXhrRequest(resolve, reject) {
            var requestData = config.data;
            var requestHeaders = config.headers;
        
        
        Severity: Major
        Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 4 hrs to fix

          Function dispatchXhrRequest has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            return new Promise(function dispatchXhrRequest(resolve, reject) {
              var requestData = config.data;
              var requestHeaders = config.headers;
          
              if (utils.isFormData(requestData)) {
          Severity: Major
          Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 4 hrs to fix

            Function debounce has 95 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function debounce(func, wait, options) {
              var lastArgs,
                  lastThis,
                  maxWait,
                  result,
            Severity: Major
            Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 3 hrs to fix

              File edit.blade.php has 304 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              @extends('layouts.app')
              
              @section('content')
              <div class="container">
                  <div class="row mb-3">
              Severity: Minor
              Found in web.sakura/resources/views/items/edit.blade.php - About 3 hrs to fix

                Consider simplifying this complex logical expression.
                Open

                    if ((inherited || hasOwnProperty.call(value, key)) &&
                        !(skipIndexes && (
                           // Safari 9 has enumerable `arguments.length` in strict mode.
                           key == 'length' ||
                           // Node.js 0.10 has enumerable non-index properties on buffers.
                Severity: Critical
                Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 2 hrs to fix

                  Method run has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function run()
                      {
                          $user = '00000000-0000-0000-0000-000000000000';
                  
                          if (! Post::where('slug', 'lolibrary-open-source')->exists()) {
                  Severity: Major
                  Found in web.sakura/database/seeds/BlogSeeder.php - About 2 hrs to fix

                    Function normalizeComponent has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function normalizeComponent (
                      rawScriptExports,
                      compiledTemplate,
                      functionalTemplate,
                      injectStyles,
                    Severity: Major
                    Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 2 hrs to fix

                      Function Errors has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var Errors = function () {
                          /**
                           * Create a new Errors instance.
                           */
                          function Errors() {
                      Severity: Major
                      Found in web.sakura/nova-components/ImageArray/dist/js/field.js - About 2 hrs to fix

                        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

                            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

                              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

                                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 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

                                    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 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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language