digitalfabrik/lunes-cms

View on GitHub

Showing 16 of 16 total issues

Function OverlayManager has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

var OverlayManager = (function(){
  var overlays = [];
  var opened = -1;

  const _manager = {
Severity: Minor
Found in lunes_cms/static/js/overlay.js - About 4 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 Overlay has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
Open

var Overlay = (function(){
  function Overlay(options){
    var overlay = document.createElement("div");
    overlay.className = "overlay";
    var open = false;
Severity: Minor
Found in lunes_cms/static/js/overlay.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 Overlay has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var Overlay = (function(){
  function Overlay(options){
    var overlay = document.createElement("div");
    overlay.className = "overlay";
    var open = false;
Severity: Major
Found in lunes_cms/static/js/overlay.js - About 3 hrs to fix

    Function OverlayManager has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var OverlayManager = (function(){
      var overlays = [];
      var opened = -1;
    
      const _manager = {
    Severity: Major
    Found in lunes_cms/static/js/overlay.js - About 3 hrs to fix

      Function Overlay has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function Overlay(options){
          var overlay = document.createElement("div");
          overlay.className = "overlay";
          var open = false;
          var events = [];
      Severity: Major
      Found in lunes_cms/static/js/overlay.js - About 2 hrs to fix

        Function display_thumbnail has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function display_thumbnail(doc) {
            let overlay = new Overlay();
        
            /*Header*/
            let header1 = document.createElement("h1");
        Severity: Minor
        Found in lunes_cms/static/js/manytomany_overlay.js - About 1 hr to fix

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

              def queryset(self, request, queryset):
                  """
                  Returns the filtered queryset based on the value
                  provided in the query string and retrievable via
                  `self.value()`.
          Severity: Minor
          Found in lunes_cms/cms/list_filter.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 public_upload has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

          def public_upload(request):
              """Public form to upload missing images
          
              :param request: current user request
              :type request: django.http.request
          Severity: Minor
          Found in lunes_cms/help/views/public_upload.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 queryset has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              def queryset(self, request, queryset):
                  """
                  Returns the filtered queryset based on the value
                  provided in the query string and retrievable via
                  `self.value()`.
          Severity: Minor
          Found in lunes_cms/cms/list_filter.py - About 55 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 make_released has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              def make_released(self, request, queryset):
                  """
                  Action to release training set objects. It sets the
                  corresponding boolean field to true.
          
          
          Severity: Minor
          Found in lunes_cms/cms/admins/training_set_admin.py - About 45 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 get_queryset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def get_queryset(self):
                  """
                  Defining custom queryset
          
                  :param self: A handle to the :class:`DisciplineViewSet`
          Severity: Minor
          Found in lunes_cms/api/v1/views/discipline_filtered_viewset.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 display_thumbnail has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          function display_thumbnail(doc) {
              let overlay = new Overlay();
          
              /*Header*/
              let header1 = document.createElement("h1");
          Severity: Minor
          Found in lunes_cms/static/js/manytomany_overlay.js - 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 linkcode_resolve has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def linkcode_resolve(domain, info):
              """
              This function adds source code links to all modules (see :mod:`sphinx:sphinx.ext.linkcode`).
              It links all classes and functions to their source files on GitHub including line numbers.
          
          
          Severity: Minor
          Found in docs/src/conf.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

          Avoid too many return statements within this function.
          Open

                  return queryset
          Severity: Major
          Found in lunes_cms/cms/list_filter.py - About 30 mins to fix

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

                def make_unreleased(self, request, queryset):
                    """
                    Action to hide discipline objects. It sets the
                    corresponding boolean field to false.
            
            
            Severity: Minor
            Found in lunes_cms/cms/admins/training_set_admin.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 application has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            def application(environ, start_response):
                """
                This returns the WSGI callable
            
                :param environ: The environment variables
            Severity: Minor
            Found in lunes_cms/core/wsgi.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