pencilblue/pencilblue

View on GitHub

Showing 760 of 1,529 total issues

Function Routes has 1585 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function Routes(pb){
    return [
        {
            method: 'get',
            path: '/media/*',
Severity: Major
Found in plugins/pencilblue/include/routes.js - About 1 wk to fix

    Function RequestHandlerModule has a Cognitive Complexity of 281 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function RequestHandlerModule(pb) {
    
        //pb dependencies
        var AsyncEventEmitter = pb.AsyncEventEmitter;
    
    
    Severity: Minor
    Found in include/http/request_handler.js - About 5 days 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 LocalizationModule has a Cognitive Complexity of 239 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function LocalizationModule(pb) {
    
        //pb dependencies
        var config = pb.config;
    
    
    Severity: Minor
    Found in include/localization.js - About 4 days 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 CustomObjectServiceModule has a Cognitive Complexity of 219 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function CustomObjectServiceModule(pb) {
    
        /**
         * Provides a service to do the heavy lifting of retrieving custom objects with
         * the ability to eagerly fetch the related objects.
    Severity: Minor
    Found in include/service/entities/custom_object_service.js - About 4 days 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 RequestHandlerModule has 894 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function RequestHandlerModule(pb) {
    
        //pb dependencies
        var AsyncEventEmitter = pb.AsyncEventEmitter;
    
    
    Severity: Major
    Found in include/http/request_handler.js - About 4 days to fix

      File routes.js has 1589 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
          Copyright (C) 2016  PencilBlue, LLC
      
          This program is free software: you can redistribute it and/or modify
          it under the terms of the GNU General Public License as published by
      Severity: Major
      Found in plugins/pencilblue/include/routes.js - About 4 days to fix

        Function PluginServiceModule has 815 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = function PluginServiceModule(pb) {
        
            /**
             * @private
             * @static
        Severity: Major
        Found in include/service/entities/plugin_service.js - About 4 days to fix

          Function CustomObjectServiceModule has 728 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function CustomObjectServiceModule(pb) {
          
              /**
               * Provides a service to do the heavy lifting of retrieving custom objects with
               * the ability to eagerly fetch the related objects.
          Severity: Major
          Found in include/service/entities/custom_object_service.js - About 3 days to fix

            Function exports has a Cognitive Complexity of 147 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = function(pb) {
            
                /**
                 * Retrieves articles and pages
                 * @deprecated
            Severity: Minor
            Found in include/service/entities/article_service.js - About 2 days 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 markdown.js has 1073 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // Released under MIT license
            // Copyright (c) 2009-2010 Dominic Baggott
            // Copyright (c) 2009-2010 Ash Berlin
            // Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> (http://www.christophdorn.com)
            
            
            Severity: Major
            Found in public/js/lib/markdown/lib/markdown.js - About 2 days to fix

              File jquery.fileupload.js has 1069 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * jQuery File Upload Plugin 5.39.0
               * https://github.com/blueimp/jQuery-File-Upload
               *
               * Copyright 2010, Sebastian Tschan
              Severity: Major
              Found in public/js/lib/jquery/jquery.fileupload.js - About 2 days to fix

                Function SectionServiceModule has 533 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function SectionServiceModule(pb) {
                
                    /**
                     * Service for managing the site's navigation
                     * @class SectionService
                Severity: Major
                Found in include/service/entities/section_service.js - About 2 days to fix

                  Function LocalizationModule has 529 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function LocalizationModule(pb) {
                  
                      //pb dependencies
                      var config = pb.config;
                  
                  
                  Severity: Major
                  Found in include/localization.js - About 2 days to fix

                    Function PluginServiceModule has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
                    Open

                    module.exports = function PluginServiceModule(pb) {
                    
                        /**
                         * @private
                         * @static
                    Severity: Minor
                    Found in include/service/entities/plugin_service.js - About 2 days 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 WPXMLParseServiceModule has 512 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function WPXMLParseServiceModule(pb) {
                    
                        //pb dependencies
                        var util           = pb.util;
                        var xml2js         = pb.NpmPluginDependencyService.require('wp_import', 'xml2js');
                    Severity: Major
                    Found in plugins/wp_import/services/wp_xml_parse.js - About 2 days to fix

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

                      module.exports = function(pb) {
                      
                          /**
                           * A templating engine that provides the ability to read in file snippets and
                           * call back for data based on the flags in the template file.  The instance
                      Severity: Major
                      Found in include/service/entities/template_service.js - About 2 days to fix

                        Function exports has a Cognitive Complexity of 120 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports = function(pb) {
                        
                            /**
                             * A templating engine that provides the ability to read in file snippets and
                             * call back for data based on the flags in the template file.  The instance
                        Severity: Minor
                        Found in include/service/entities/template_service.js - About 2 days 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 exports has a Cognitive Complexity of 114 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports = function (pb) {
                        
                            //pb dependencies
                            var util = pb.util;
                            var BaseObjectService = pb.BaseObjectService;
                        Severity: Minor
                        Found in include/service/entities/plugins/plugin_validation_service.js - About 2 days 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 DAOModule has 456 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        module.exports = function DAOModule(pb) {
                        
                            /**
                             * Controlls the data model
                             *
                        Severity: Major
                        Found in include/dao/dao.js - About 2 days to fix

                          Function AdminNavigationModule has a Cognitive Complexity of 112 (exceeds 5 allowed). Consider refactoring.
                          Open

                          module.exports = function AdminNavigationModule(pb) {
                          
                              //PB dependencies
                              var SecurityService = pb.SecurityService;
                              var GLOBAL_SITE = pb.SiteService.GLOBAL_SITE;
                          Severity: Minor
                          Found in include/admin_navigation.js - About 2 days 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