amenezes/headers

View on GitHub

Showing 15 of 143 total issues

Function init_echarts has 723 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function init_echarts() {

                if( typeof (echarts) === 'undefined'){ return; }
                  var theme = {
                  color: [
Severity: Major
Found in web/static/build/js/custom.js - About 3 days to fix

File custom.js has 1046 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * Resize function without multiple trigger
 *
 * Usage:
 * $(window).smartresize(function(){
Severity: Major
Found in web/static/build/js/custom.js - About 2 days to fix

Function success has 114 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        success: function(response){

      var header = document.getElementById('csp_total');
      while (header.firstChild) {
        header.removeChild(header.firstChild);
Severity: Major
Found in web/static/build/js/custom.js - About 4 hrs to fix

Function init_DataTables has 95 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            function init_DataTables(response) {

                //console.log('run_datatables');

                if( typeof ($.fn.DataTable) === 'undefined'){ return; }
Severity: Major
Found in web/static/build/js/custom.js - About 3 hrs to fix

Function init_echarts has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

        function init_echarts() {

                if( typeof (echarts) === 'undefined'){ return; }
                  var theme = {
                  color: [
Severity: Minor
Found in web/static/build/js/custom.js - About 3 hrs 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 success has 80 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          success: function(response){

        var header = document.getElementById('sts_total');
        while (header.firstChild) {
          header.removeChild(header.firstChild);
Severity: Major
Found in web/static/build/js/custom.js - About 3 hrs to fix

Function success has 75 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          success: function(response){

        var header = document.getElementById('xcto_total');
        while (header.firstChild) {
          header.removeChild(header.firstChild);
Severity: Major
Found in web/static/build/js/custom.js - About 3 hrs to fix

Function success has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          success: function(response){

        var header = document.getElementById('xss_total');
        while (header.firstChild) {
          header.removeChild(header.firstChild);
Severity: Major
Found in web/static/build/js/custom.js - About 2 hrs to fix

Function init_sidebar has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function init_sidebar() {
var setContentHeight = function () {
    // reset height
    $RIGHT_COL.css('min-height', $(window).height());

Severity: Major
Found in web/static/build/js/custom.js - About 2 hrs to fix

Function success has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          success: function(response){

        var header = document.getElementById('xfo_total');
        while (header.firstChild) {
          header.removeChild(header.firstChild);
Severity: Major
Found in web/static/build/js/custom.js - About 2 hrs to fix

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

            success: function(response){

          var header = document.getElementById('pkp_total');
          while (header.firstChild) {
            header.removeChild(header.firstChild);
Severity: Minor
Found in web/static/build/js/custom.js - About 1 hr to fix

Function handleDataTableButtons has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                var handleDataTableButtons = function() {
                  if ($("#datatable-buttons").length) {
                    $("#datatable-buttons").DataTable({
                      dom: "Bfrtip",
                      buttons: [
Severity: Minor
Found in web/static/build/js/custom.js - About 1 hr to fix

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

def siteinfo(site=''):
    '''Secure headers used by a specific <url>'''
    values = ()
    percent_list = []
    if site != '':
Severity: Minor
Found in web/webui.py - 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 work_headers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def work_headers(self, item):
        site_id = item[0]
        site = item[1]
        url, code, headers = self.scanner.get_data(site)
        self.site_table.append([site_id, site, url, code])
Severity: Minor
Found in lib/scanner/headers.py - 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 save has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def save(self, command, table_name, table):
        self.conn = self.get_db_connection()
        cursor = self.conn.cursor()
        print('Table: {}').format(table_name)
        if type(table) is list:
Severity: Minor
Found in lib/database/db.py - 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