cssnext/cssnext

View on GitHub

Showing 11 of 20 total issues

Function render has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { file } = this.props;
    const footer = file.footer === undefined ? true : file.footer;

    if (!file.title) {
Severity: Major
Found in docs/src/layouts/Default.js - About 4 hrs to fix

    `` has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default {
      /**
       * REMINDER:
       * ******************
       * order is important
    Severity: Minor
    Found in src/features.js - About 3 hrs to fix

      Function plugin has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const plugin = postcss.plugin("postcss-cssnext", options => {
        options = {
          console: console,
          warnForDuplicates: true,
          warnForDeprecations: true,
      Severity: Major
      Found in src/index.js - About 2 hrs to fix

        Function render has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            return (
              <header className="cssnext-Header js-Headroom">
                <div style={{ background: "#000", color: "#fff", textAlign: "center" }}>
                  <a href="https://moox.io/blog/deprecating-cssnext/">
        Severity: Minor
        Found in docs/src/modules/Header/index.js - About 1 hr to fix

          Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              return (
                <footer className="cssnext-Footer">
                  <p>
                    <SVGIcon
          Severity: Minor
          Found in docs/src/modules/Footer/index.js - About 1 hr to fix

            Function playground has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function playground(opts) {
              opts.options = opts.options || {};
            
              if (!opts.from || !opts.to || !opts.console) {
                throw new Error(
            Severity: Minor
            Found in docs/src/modules/playground/index.js - About 1 hr to fix

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

                function transformCSS() {
                  const css = opts.from.value;
              
                  opts.console.innerHTML = "";
                  opts.messages.textContent = "";
              Severity: Minor
              Found in docs/src/modules/playground/index.js - About 1 hr to fix

                Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const { file } = this.props;
                    const footer = file.footer === undefined ? true : file.footer;
                
                    if (!file.title) {
                Severity: Minor
                Found in docs/src/layouts/Simple.js - About 1 hr to fix

                  Function testFeature has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  const testFeature = function(t, feature, source, input, expected, slug) {
                  Severity: Minor
                  Found in src/__tests__/option.features.js - About 45 mins to fix

                    Consider simplifying this complex logical expression.
                    Open

                        if (
                          // feature is not disabled
                          features[key] !== false &&
                          // feature is enabled
                          (features[key] === true ||
                    Severity: Major
                    Found in src/index.js - About 40 mins to fix

                      Function playground has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function playground(opts) {
                        opts.options = opts.options || {};
                      
                        if (!opts.from || !opts.to || !opts.console) {
                          throw new Error(
                      Severity: Minor
                      Found in docs/src/modules/playground/index.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

                      Severity
                      Category
                      Status
                      Source
                      Language