mcfiredrill/forttree

View on GitHub

Showing 15 of 19 total issues

Function init has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function init (converter) {
        function api (key, value, attributes) {
            var result;

            // Write
Severity: Major
Found in app/assets/javascripts/js-cookie/js.cookie.js - About 3 hrs to fix

    Function draw has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    FortScene.prototype.draw = function($container) {
      // Initialize the 3d crap.
      var w = this.$container.innerWidth();
      var h = $(window).innerHeight() - $('header').innerHeight() - 50;
    
    
    Severity: Major
    Found in app/assets/javascripts/fort-scene.js - About 2 hrs to fix

      Function api has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function api (key, value, attributes) {
                  var result;
      
                  // Write
      
      
      Severity: Major
      Found in app/assets/javascripts/js-cookie/js.cookie.js - About 2 hrs to fix

        Function caret has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          $.fn.caret = function(pos) {
            var target = this[0];
            var isContentEditable = target.contentEditable === 'true';
            //get
            if (arguments.length == 0) {
        Severity: Major
        Found in app/assets/javascripts/caret/jquery.caret.js - About 2 hrs to fix

          Method create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def create
              @branch = Branch.new(:last_post_at => Time.now)
              @leaf = Leaf.new(leaf_params)
              @branches = Branch.page(params[:page])
          
          
          Severity: Minor
          Found in app/controllers/branches_controller.rb - 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

          Method update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def update
              @board = Board.find(params[:id])
          
              respond_to do |format|
                if Admin.authenticate(params[:password])
          Severity: Minor
          Found in app/controllers/boards_controller.rb - 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

          Method create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def create
              @board = Board.new board_params
              respond_to do |format|
                if Admin.authenticate(params[:password])
                  if @board.save!
          Severity: Minor
          Found in app/controllers/boards_controller.rb - 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

          Method update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def update
              board = Board.find(params[:board_id])
              branch = Branch.find(params[:id])
              @post_form = PostForm.new board, branch, Leaf.new(@captcha.values)
              respond_to do |format|
          Severity: Minor
          Found in app/controllers/posts_controller.rb - 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

          Method create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def create
              board = Board.find(params[:board_id])
              @post_form = PostForm.new board, Branch.new, Leaf.new(@captcha.values)
              respond_to do |format|
                if @captcha.valid? && @post_form.save!
          Severity: Minor
          Found in app/controllers/posts_controller.rb - 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

          Method destroy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def destroy
              @board = Board.find(params[:id])
          
              respond_to do |format|
                if Admin.authenticate(params[:delete_password])
          Severity: Minor
          Found in app/controllers/boards_controller.rb - 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 target.selectionStart;
          Severity: Major
          Found in app/assets/javascripts/caret/jquery.caret.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return 0;
            Severity: Major
            Found in app/assets/javascripts/caret/jquery.caret.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return this;
              Severity: Major
              Found in app/assets/javascripts/caret/jquery.caret.js - About 30 mins to fix

                Method destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def destroy
                    params[:delete].each do |id|
                      @leaf = Leaf.find(id)
                      @branch = Branch.find(@leaf.branch_id)
                      if @branch.leafs.count <= 1
                Severity: Minor
                Found in app/controllers/branches_controller.rb - 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

                Method destroy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  def destroy
                    board = Board.find(params[:board_id])
                    params[:delete].each do |id|
                      @leaf = Leaf.find(id)
                      @branch = Branch.find(@leaf.branch_id)
                Severity: Minor
                Found in app/controllers/posts_controller.rb - 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