suever/MATL-Online

View on GitHub

Showing 5 of 54 total issues

File main.js has 375 lines of code (exceeds 250 allowed). Consider refactoring.
Open

$(document).ready(function() {
    var table = null;

    var socket = io.connect(window.location.protocol +
                            '//' + document.domain +
Severity: Minor
Found in matl_online/static/js/main.js - About 5 hrs to fix

    Function toggleDocumentation has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function toggleDocumentation(){
    
            var navitem = $('#doctoggle').parent();
            var activeClasses = 'col-md-6 col-lg-6 col-sm-6';
    
    
    Severity: Major
    Found in matl_online/static/js/main.js - About 2 hrs to fix

      Function parse_matl_results has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def parse_matl_results(output: str) -> List[Dict[str, str]]:
          """Convert MATL output to a custom data structure.
      
          Takes all the output and parses it out into sections to pass back
          to the client which indicates stderr/stdout/images, etc.
      Severity: Minor
      Found in matl_online/matl/io.py - About 1 hr 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 refresh_releases has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def refresh_releases(
          repository: str = Config.MATL_REPOSITORY,
          source_root: pathlib.Path = Config.MATL_SOURCE_DIRECTORY,
      ) -> None:
          """Fetch new release information from GitHub and update local database."""
      Severity: Minor
      Found in matl_online/matl/releases.py - About 35 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 process_message has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def process_message(self, message: str) -> None:
              """Append a message to be sent back to the user."""
              print(message)
      
              if message == "[PAUSE]":
      Severity: Minor
      Found in matl_online/tasks.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