inderpartap/Bunk-O-Meter

View on GitHub

Showing 186 of 189 total issues

Avoid too many return statements within this function.
Open

                return results;
Severity: Major
Found in static/assets/js/jquery-1.10.2.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return compare & 4 ? -1 : 1;
    Severity: Major
    Found in static/assets/js/jquery-1.10.2.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return rootjQuery.ready( selector );
      Severity: Major
      Found in static/assets/js/jquery-1.10.2.js - About 30 mins to fix

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

        function renameTable(tableId, tableName) {
            for (var i = 0; i < timeTableStorage.length; i++) {
                if (timeTableStorage[i].id == tableId) {
                    timeTableStorage[i].name = tableName;
                    updateLocalForage();
        Severity: Minor
        Found in static/timetable/js/colorchange.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 getPixelMapFromImageData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        var getPixelMapFromImageData = function(imgData) {
            var pixMap=[];
            var count=0;
            var temp=[];
            for (var i=0;i<imgData.data.length;i+=4)
        Severity: Minor
        Found in captcha.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 removeTable has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function removeTable(tableId) {
            for (var i = 0; i < timeTableStorage.length; ++i) {
                if (timeTableStorage[i].id == tableId) {
                    // If it is the active table, change activeTable.
                    if (activeTable.id == tableId) {
        Severity: Minor
        Found in static/timetable/js/colorchange.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