pencilblue/pencilblue

View on GitHub

Showing 1,529 of 1,529 total issues

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

module.exports = {
    generic: {
        LOCALE_DISPLAY: 'Français (France)',
        PENCILBLUE: 'PencilBlue',
        ALL_RIGHTS: 'Tous droits réservés',
Severity: Major
Found in public/localization/fr-FR.js and 1 other location - About 2 wks to fix
public/localization/pt-BR.js on lines 1..488

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

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

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

module.exports = {
    generic: {
        LOCALE_DISPLAY: 'Português (Brasil)',
        PENCILBLUE: 'pencilblue',
        ALL_RIGHTS: 'Todos os direitos reservados',
Severity: Major
Found in public/localization/pt-BR.js and 1 other location - About 2 wks to fix
public/localization/fr-FR.js on lines 1..488

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

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

module.exports = {
    generic: {
        LOCALE_DISPLAY: 'Nederlands',
        PENCILBLUE: 'PencilBlue',
        ALL_RIGHTS: 'Alle rechten voorbehouden',
Severity: Major
Found in public/localization/nl-BE.js and 2 other locations - About 2 wks to fix
public/localization/fa-IR.js on lines 1..487
public/localization/zh-CN.js on lines 1..487

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

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

module.exports = {
    generic: {
        LOCALE_DISPLAY: 'فارسی (ایران)',
        PENCILBLUE: 'پنسیل بلو',
        ALL_RIGHTS: 'تمامی حقوق محفوط است.',
Severity: Major
Found in public/localization/fa-IR.js and 2 other locations - About 2 wks to fix
public/localization/nl-BE.js on lines 1..487
public/localization/zh-CN.js on lines 1..487

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

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

Similar blocks of code found in 3 locations. Consider refactoring.
Open

module.exports = {
    generic: {
        LOCALE_DISPLAY: '简体中文 (中国大陆)',
        PENCILBLUE: 'PencilBlue',
        ALL_RIGHTS: '版权所有',
Severity: Major
Found in public/localization/zh-CN.js and 2 other locations - About 2 wks to fix
public/localization/fa-IR.js on lines 1..487
public/localization/nl-BE.js on lines 1..487

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

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

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

        generic: {
            LOCALE_DISPLAY: 'Deutsch (Deutschland)',
            PENCILBLUE: 'PencilBlue',
            ALL_RIGHTS: 'All rights reserved',
            NONE: 'keine',
    Severity: Major
    Found in public/localization/de-DE.js and 1 other location - About 4 days to fix
    public/localization/ro-RO.js on lines 2..165

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

    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

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

        generic: {
            LOCALE_DISPLAY: 'Român (România)',
            PENCILBLUE: 'PencilBlue',
            ALL_RIGHTS: 'Toate drepturile rezervate',
            NONE: 'Niciunul',
    Severity: Major
    Found in public/localization/ro-RO.js and 1 other location - About 4 days to fix
    public/localization/de-DE.js on lines 17..180

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

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

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

          module.exports = function(pb) {
          
              //pb dependencies
              var util = pb.util;
          
          
          Severity: Major
          Found in plugins/pencilblue/controllers/article.js and 1 other location - About 3 days to fix
          plugins/pencilblue/controllers/page.js on lines 19..131

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

          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

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

          module.exports = function(pb) {
          
              //pb dependencies
              var util = pb.util;
          
          
          Severity: Major
          Found in plugins/pencilblue/controllers/page.js and 1 other location - About 3 days to fix
          plugins/pencilblue/controllers/article.js on lines 18..130

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

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