adobe/brackets

View on GitHub
src/LiveDevelopment/main.js

Summary

Maintainability
D
2 days
Test Coverage

Function main has 264 lines of code (exceeds 25 allowed). Consider refactoring.
Open

define(function main(require, exports, module) {
    "use strict";

    var DocumentManager     = require("document/DocumentManager"),
        Commands            = require("command/Commands"),
Severity: Major
Found in src/LiveDevelopment/main.js - About 1 day to fix

    Function main has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

    define(function main(require, exports, module) {
        "use strict";
    
        var DocumentManager     = require("document/DocumentManager"),
            Commands            = require("command/Commands"),
    Severity: Minor
    Found in src/LiveDevelopment/main.js - About 5 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

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

    /*
     * Copyright (c) 2012 - present Adobe Systems Incorporated. All rights reserved.
     *
     * Permission is hereby granted, free of charge, to any person obtaining a
     * copy of this software and associated documentation files (the "Software"),
    Severity: Minor
    Found in src/LiveDevelopment/main.js - About 2 hrs to fix

      Function _setImplementation has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function _setImplementation(multibrowser) {
              if (multibrowser) {
                  // set implemenation
                  LiveDevImpl = MultiBrowserLiveDev;
                  // update styles for UI status
      Severity: Minor
      Found in src/LiveDevelopment/main.js - About 1 hr to fix

        There are no issues that match your filters.

        Category
        Status