salomax/livremarketplace

View on GitHub

Showing 43 of 1,450 total issues

Function _init has 262 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function _init() {
  'use strict';
  /* Layout
   * ======
   * Fixes the layout height in case min-height fails.
Severity: Major
Found in static/js/vendor.min.js - About 1 day to fix

    File livremarketplace.js has 542 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /******************************************************************************
     * livremarketplace.js
     *
     * Copyright 2016 Marcos Salomão
     *
    Severity: Major
    Found in static/js/livremarketplace.js - About 1 day to fix

      Function _init has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring.
      Open

      function _init() {
        'use strict';
        /* Layout
         * ======
         * Fixes the layout height in case min-height fails.
      Severity: Minor
      Found in static/js/vendor.min.js - About 1 day 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

      File vendor.min.js has 455 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      // http://stackoverflow.com/questions/19329530/onresize-for-div-elements
      (function(){
      
      var attachEvent = document.attachEvent;
      
      
      Severity: Minor
      Found in static/js/vendor.min.js - About 6 hrs to fix

        Function loadPage has 168 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                loadPage : function() {
        
                    $('table.table-purchases').fadeOut();
        
                    // Aplicar i18n
        Severity: Major
        Found in static/app/purchase/purchase.js - About 6 hrs to fix

          Function loadPage has 129 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  loadPage : function() {
          
                      // Aplicar i18n
                      $('span.tab_list').text(messages.sale.tab.list);
                      $('span.tab_save').text(messages.sale.tab.save);
          Severity: Major
          Found in static/app/sale/sale.js - About 5 hrs to fix

            Function loadTable has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    loadTable : function(_data) {
            
                        // Construir tabela
                        $('table.table-purchases').bootstrapTable({
                                uniqueId : 'id',
            Severity: Major
            Found in static/app/purchase/purchase.js - About 4 hrs to fix

              File purchase.js has 346 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /******************************************************************************
               * purchase.js
               *
               * Copyright 2016 Marcos Salomão
               *
              Severity: Minor
              Found in static/app/purchase/purchase.js - About 4 hrs to fix

                Function getMenus has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                         getMenus : function() {
                             return [
                                     {
                                         header : messages.menu.header.management
                                     }, 
                Severity: Major
                Found in static/js/livremarketplace.js - About 2 hrs to fix

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

                          bindTable : function(_data) {
                  
                              // Construir tabela
                              $('table.table-sales').bootstrapTable({
                                  uniqueId: 'id',
                  Severity: Major
                  Found in static/app/sale/sale.js - About 2 hrs to fix

                    Function maps has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        $.fn.maps = function(options) {
                    
                            var element = $(this);
                    
                            // Verificar se o elemento já não está carregado
                    Severity: Major
                    Found in static/js/livremarketplace.js - About 2 hrs to fix

                      Function loadPage has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                               loadPage : function() {
                      
                                  // Aplicar i18n
                                  $('span.tab_list').text(messages.supplier.tab.list);
                                  $('span.tab_save').text(messages.supplier.tab.save);
                      Severity: Major
                      Found in static/app/supplier/supplier.js - About 2 hrs to fix

                        Function loadPage has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                loadPage : function() {
                        
                                    // Aplicar i18n
                                    $('span.tab_list').text(messages.customer.tab.list);
                                    $('span.tab_save').text(messages.customer.tab.save);
                        Severity: Major
                        Found in static/app/customer/customer.js - About 2 hrs to fix

                          File sale.js has 259 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /******************************************************************************
                           * sale.js
                           *
                           * Copyright 2016 Marcos Salomão
                           *
                          Severity: Minor
                          Found in static/app/sale/sale.js - About 2 hrs to fix

                            Function $elect has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                $.fn.$elect = function(selectOptions) {
                            
                                    // Init validation
                                    if (!selectOptions || !selectOptions.search || !selectOptions.formatData) {
                                        console.warning('$elect initialized inappropriately');
                            Severity: Minor
                            Found in static/js/livremarketplace.js - About 1 hr to fix

                              Function initLayout has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                $.AdminLTE.initLayout = function() {
                              
                                  //Fix for IE page transitions
                                  $("body").removeClass("hold-transition");
                              
                              
                              Severity: Minor
                              Found in static/js/vendor.min.js - About 1 hr to fix

                                Function bindTable has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        bindTable : function(_data) {
                                
                                            // Construir tabela
                                            $('table.table-products').bootstrapTable({
                                                uniqueId : 'id',
                                Severity: Minor
                                Found in static/app/product/product.js - About 1 hr to fix

                                  Function frete has 15 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def frete(self, cod, GOCEP, HERECEP, peso, formato,
                                  Severity: Major
                                  Found in app/postal/correios.py - About 1 hr to fix

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

                                            openMenu : function(menu) {
                                    
                                                $('section.content').hide();
                                    
                                                // Definir o icon
                                    Severity: Minor
                                    Found in static/js/livremarketplace.js - About 1 hr to fix

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

                                              loadPage : function() {
                                      
                                                  // Carregar a lista de produtos
                                                  $.product.view.loadTable();
                                      
                                      
                                      Severity: Minor
                                      Found in static/app/product/product.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language