cssnext/cssnext

View on GitHub

Showing 20 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              <Body
                scripts={[
                  ...(file.scripts || []),
                  ...(this.props.metadata.assets.scripts || [])
                ]}
      Severity: Major
      Found in docs/src/layouts/Default.js and 1 other location - About 2 hrs to fix
      docs/src/layouts/Simple.js on lines 30..42

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 79.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              <Body
                scripts={[
                  ...(file.scripts || []),
                  ...(this.props.metadata.assets.scripts || [])
                ]}
      Severity: Major
      Found in docs/src/layouts/Simple.js and 1 other location - About 2 hrs to fix
      docs/src/layouts/Default.js on lines 33..130

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 79.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                  instance.process("body{}").then(() => {
                    t.equal(messages.length, 0, "should not add warning if no duplicate");
                    t.end();
                  }, reportFail(t));
                Severity: Major
                Found in src/__tests__/option.warnForDuplicates.js and 2 other locations - About 1 hr to fix
                src/__tests__/option.warnForDeprecations.js on lines 21..28
                src/__tests__/option.warnForDuplicates.js on lines 59..66

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 56.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                  instance.process("body{}").then(() => {
                    t.equal(
                      messages.length,
                      0,
                      "should NOT add warning if there are duplicates but !warnForDuplicates"
                Severity: Major
                Found in src/__tests__/option.warnForDuplicates.js and 2 other locations - About 1 hr to fix
                src/__tests__/option.warnForDeprecations.js on lines 21..28
                src/__tests__/option.warnForDuplicates.js on lines 22..25

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 56.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 3 locations. Consider refactoring.
                Open

                  instance.process("body{}").then(() => {
                    t.equal(
                      messages.length,
                      0,
                      "should not add warning there is no deprecated stuff"
                Severity: Major
                Found in src/__tests__/option.warnForDeprecations.js and 2 other locations - About 1 hr to fix
                src/__tests__/option.warnForDuplicates.js on lines 22..25
                src/__tests__/option.warnForDuplicates.js on lines 59..66

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 56.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        stats.compilation.errors.forEach(item =>
                          log(...[color.red("Error:"), ...item.message.split("\n")])
                        );
                  Severity: Minor
                  Found in docs/scripts/webpack.js and 1 other location - About 55 mins to fix
                  docs/scripts/webpack.js on lines 17..19

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 54.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                        stats.compilation.warnings.forEach(item =>
                          log(...[color.yellow("Warning:"), ...item.message.split("\n")])
                        );
                  Severity: Minor
                  Found in docs/scripts/webpack.js and 1 other location - About 55 mins to fix
                  docs/scripts/webpack.js on lines 11..13

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 54.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  Simple.propTypes = {
                    pkg: PropTypes.object.isRequired,
                    metadata: PropTypes.object.isRequired,
                    // collections: PropTypes.object.isRequired,
                    file: PropTypes.object.isRequired
                  Severity: Minor
                  Found in docs/src/layouts/Simple.js and 1 other location - About 55 mins to fix
                  docs/src/layouts/Default.js on lines 136..141

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 53.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  Default.propTypes = {
                    pkg: PropTypes.object.isRequired,
                    metadata: PropTypes.object.isRequired,
                    // collections: PropTypes.object.isRequired,
                    file: PropTypes.object.isRequired
                  Severity: Minor
                  Found in docs/src/layouts/Default.js and 1 other location - About 55 mins to fix
                  docs/src/layouts/Simple.js on lines 48..53

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 53.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  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