pinclub/pinclub

View on GitHub

Showing 850 of 1,424 total issues

Avoid too many return statements within this function.
Open

  return true;
Severity: Major
Found in public/libs/markdownit.js - About 30 mins to fix

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

    window.particlesJS = function(tag_id, params){
    
      //console.log(params);
    
      /* no string id? so it's object params, and set the id with default id */
    Severity: Minor
    Found in public/libs/particles/particles.js - 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

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

    function loadTopicList (page, forum, title, selfrefresh) {
        var params = 'show_type=index';
        if (!page) {
            page = 1;
        }
    Severity: Minor
    Found in public/javascripts/forum.js - 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

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

    function showBoardList (target, boards) {
        if (!target || !boards) {
            return;
        }
        target.html('');
    Severity: Minor
    Found in public/javascripts/board.js - 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

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

    function avatarPath(avatar, size) {
        if (!avatar || !size) {
            return avatar;
        }
        var file_path = '';
    Severity: Minor
    Found in public/javascripts/main.js - 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

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

    exports.signup = function (req, res, next) {
        var loginname = validator.trim(req.body.loginname).toLowerCase();
        var email = validator.trim(req.body.email).toLowerCase();
        var pass = validator.trim(req.body.pass);
        var rePass = validator.trim(req.body.re_pass);
    Severity: Minor
    Found in controllers/sign.js - 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

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

    var create = function (req, res, next) {
        var title = validator.trim(req.body.title || '');
        var forum = validator.trim(req.body.forum) || '';
        var content = validator.trim(req.body.content || '');
    
    
    Severity: Minor
    Found in api/v1/topic.js - 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

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

    function topicObject (topic, type, callback){
        let counter = new Counter(topic);
        let optCount = 1;
        if (type === 'getted') {
            counter.gettedCount(optCount);
    Severity: Minor
    Found in common/counter.js - 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

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

    var index = function (req, res, next) {
        var type = req.query.type;
        var currentUser = req.session.user;
        var page = parseInt(req.query.page, 10) || 1;
        page = page > 0 ? page : 1;
    Severity: Minor
    Found in api/v2/board.js - 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

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

    var create = function (req, res, next) {
        var title = validator.trim(req.body.title || '');
        var forum = validator.trim(req.body.forum);
        var content = validator.trim(req.body.content || '');
    
    
    Severity: Minor
    Found in api/v2/topic.js - 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